viv_1005
Junior Member level 3
Hello!
I have written following code.
task buffer_data(var reg [3:0] data_out) {
reg [7:0] data_buf;
fork {
while(1) {
@(posedge my_port.$clk_one);
data_buf <= my_port.$data_in;
}
while(1) {
@(posedge my_port.$clk_two);
data_out <= data_buf[7:4];
@(posedge my_port.$clk_two);
data_out <= data_buf[3:0];
}
join none
}
I am getting an error at all the lines where non-blocking assignment is used. If I use blocking assignment, then there is no problem. The error is
Illegal lvalue for drive operation.
What can be the reason. Where am I going wrong?
Thanks in advance
- Viv
I have written following code.
task buffer_data(var reg [3:0] data_out) {
reg [7:0] data_buf;
fork {
while(1) {
@(posedge my_port.$clk_one);
data_buf <= my_port.$data_in;
}
while(1) {
@(posedge my_port.$clk_two);
data_out <= data_buf[7:4];
@(posedge my_port.$clk_two);
data_out <= data_buf[3:0];
}
join none
}
I am getting an error at all the lines where non-blocking assignment is used. If I use blocking assignment, then there is no problem. The error is
Illegal lvalue for drive operation.
What can be the reason. Where am I going wrong?
Thanks in advance
- Viv