Forum Discussion
Altera_Forum
Honored Contributor
14 years agoNeed help with Verilog sending values
I failed to send values between 2 modules. Please help me fix it:
// top.v
module top;
src s(
.value (value)
);
wire value;
des d(
.value (value)
);
endmodule
// src.v
module src(value);
output value;
assign value = "Hello";
endmodule
// des.v
module des(value);
input value;
$display("%s", value); // Display nothing
endmodule
5 Replies
- Altera_Forum
Honored Contributor
Just a guess, but move your wire statement to the top, before it is used, i.e.,
Cheers, Davemodule top; wire value; src s( .value (value) ); des d( .value (value) ); endmodule - Altera_Forum
Honored Contributor
That didn't work. :p
- Altera_Forum
Honored Contributor
--- Quote Start --- That didn't work. :p --- Quote End --- Why don't you post your code and the code for your testbench. If you don't have a testbench, then its time to write one :) Test the testbench using Modelsim, and then synthesize your design using Quartus. Cheers, Dave - Altera_Forum
Honored Contributor
Erm, looking back at your original code, you are trying to transmit a string via a single wire. I don't think you can do that in Verilog. You need to look for a Verilog example of how to use strings, I think you need a multibit wire ... but I don't code much in Verilog.
Cheers, Dave - Altera_Forum
Honored Contributor
Thanks for the tip. That was a multibit issue, and I just worked that out. :)