usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

Block controller hangs in testbench

J
jmaloyan@umass.edu
Thu, Feb 9, 2023 8:10 PM

Hello,

I am currently trying to figure out how to use the testbench. I am currently using rfnoc-gain and rfnoc-keep_one_in_n as reference.

When I run my testbench, my code hangs on the line that write to the register of the block

write_reg(port, dut.REG_MODE, mode);

where write_reg is the following task…

// Translate the desired register access to a ctrlport write request.

task automatic write_reg(input logic [$clog2(NUM_PORTS)-1:0] port, input ctrl_address_t addr, input logic [31:0] value);

blk_ctrl.reg_write(256*8*port + addr*8, value);

endtask : write_reg

When I run the same line in the example “rfnoc-keep-one-in-n” It does not hang, so I am led to believe that I am missing something, but I don’t know where. I am wondering if anyone else has come across a similar issue.

Thanks

Joe

Hello, I am currently trying to figure out how to use the testbench. I am currently using rfnoc-gain and rfnoc-keep_one_in_n as reference. When I run my testbench, my code hangs on the line that write to the register of the block `write_reg(port, dut.REG_MODE, mode);` where write_reg is the following task… `// Translate the desired register access to a ctrlport write request.` ` task automatic write_reg(input logic [$clog2(NUM_PORTS)-1:0] port, input ctrl_address_t addr, input logic [31:0] value);` ` blk_ctrl.reg_write(256*8*port + addr*8, value);` ` endtask : write_reg` When I run the same line in the example “rfnoc-keep-one-in-n” It does not hang, so I am led to believe that I am missing something, but I don’t know where. I am wondering if anyone else has come across a similar issue. Thanks Joe
WF
Wade Fife
Mon, Feb 13, 2023 2:59 PM

Hi Joe,

You could try stepping through the testbench code in the simulator to see
where it's hanging, or look at your block's signals in the simulation to
see what it does with the write. Make sure it behaves the same as one of
the register writes in a working testbench.

Perhaps a reset signal is not deasserted or one of the clocks is not
toggling. It could be waiting for the acknowledgement from the write, but
not receiving one. Here's where the acknowledgement is made in the gain
example:

https://github.com/EttusResearch/uhd/blob/5fac246bc18ab04cb4870026a630e46d0fd87b17/host/examples/rfnoc-example/fpga/rfnoc_block_gain/rfnoc_block_gain.v#L259

Wade

On Thu, Feb 9, 2023 at 2:10 PM jmaloyan@umass.edu wrote:

Hello,

I am currently trying to figure out how to use the testbench. I am
currently using rfnoc-gain and rfnoc-keep_one_in_n as reference.

When I run my testbench, my code hangs on the line that write to the
register of the block

write_reg(port, dut.REG_MODE, mode);

where write_reg is the following task…

// Translate the desired register access to a ctrlport write request.

task automatic write_reg(input logic [$clog2(NUM_PORTS)-1:0] port, input
ctrl_address_t addr, input logic [31:0] value);

blk_ctrl.reg_write(2568port + addr*8, value);

endtask : write_reg

When I run the same line in the example “rfnoc-keep-one-in-n” It does not
hang, so I am led to believe that I am missing something, but I don’t know
where. I am wondering if anyone else has come across a similar issue.

Thanks

Joe


USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.com

Hi Joe, You could try stepping through the testbench code in the simulator to see where it's hanging, or look at your block's signals in the simulation to see what it does with the write. Make sure it behaves the same as one of the register writes in a working testbench. Perhaps a reset signal is not deasserted or one of the clocks is not toggling. It could be waiting for the acknowledgement from the write, but not receiving one. Here's where the acknowledgement is made in the gain example: https://github.com/EttusResearch/uhd/blob/5fac246bc18ab04cb4870026a630e46d0fd87b17/host/examples/rfnoc-example/fpga/rfnoc_block_gain/rfnoc_block_gain.v#L259 Wade On Thu, Feb 9, 2023 at 2:10 PM <jmaloyan@umass.edu> wrote: > Hello, > > > I am currently trying to figure out how to use the testbench. I am > currently using rfnoc-gain and rfnoc-keep_one_in_n as reference. > > > When I run my testbench, my code hangs on the line that write to the > register of the block > > write_reg(port, dut.REG_MODE, mode); > > where write_reg is the following task… > > // Translate the desired register access to a ctrlport write request. > > task automatic write_reg(input logic [$clog2(NUM_PORTS)-1:0] port, input > ctrl_address_t addr, input logic [31:0] value); > > blk_ctrl.reg_write(256*8*port + addr*8, value); > > endtask : write_reg > > When I run the same line in the example “rfnoc-keep-one-in-n” It does not > hang, so I am led to believe that I am missing something, but I don’t know > where. I am wondering if anyone else has come across a similar issue. > > Thanks > > Joe > _______________________________________________ > USRP-users mailing list -- usrp-users@lists.ettus.com > To unsubscribe send an email to usrp-users-leave@lists.ettus.com >