I am providing input to an SPI interface. The input signal is a concatenation of several different signals. What I would like to do in simulation is have continuous concatenation of the different signals into one final string that will be sent to the SPI:
logic [7:0] foo; // Signal 1
logic [7:0] bar; // Signal 2
logic [15:0] combine; // Final signal
assign combine = {foo, bar};
task SendSPI;
begin
foo = 8'hFF;
bar = 8'h00;
SendToSpi(combine); // Want it to send 16'hFF00;
endtask;
The above code compiles and runs on the simulator (Cadence NC sim), but the value of combine is undefined (xxxx). I know I can get around this by having a concatenation task:
task CombineSignal;
begin
combine = {foo, bar};
endtask;
and I would call that task everytime I wanted to concatenate, but having continuous assignment work would be really nice! Does anyone know if continuous assignment is possible in a situation like this?
wire
orreg
instead oflogic
? \$\endgroup\$