alexforencich/cocotbext-axi

Assigning value to individual signals of AXI Read Address Channel

ManjunathKalmath opened this issue · 9 comments

Greetings Alex,

I am working on testing of AXI modules using cocotb framework.

I need to assign value to individual signals of AXI Read Address Channel.

Can you help me with this?

I tried with the following but failed,

tb.axi_master.read(address=addr, length=len ....)

Thanks Alex!!

What signals specifically do you want to set? You can influence quite a bit, but you can't arbitrarily set whatever you want.

Yes, mainly address, length, size, cache, protection bits

You should be able to set all of that when calling read(). Length and address will naturally be modified when the request is split up into bursts, but the other values should get passed through as is. What issue are you running in to, exactly?

Thanks Alex!!

I am using your AXI IPs (Verilog AXI Components). And I would like to do only one request(either write or read).
Say, I am performing one write transaction, no read. Simulation resulting in successful pass but I am able to see unknown('x') when I view waveform under Read Channel Signals.

I want to avoid this. I need some help here.

I am able to remove unknowns("x").

I wanted to pass length as an argument for tb.axi_master.write().

But, found that it throws TyperError: Unexpected keyword argument.

Can you guide me, any alternative I can follow?

Thanks Alex!!

I think all of the signals aside from ready/valid are set to X initially. They will get changed when the first operation takes place. There has been some talk about setting everything to X whenever the valid signal is low, but it's not set up that way yet.

Are the Xs causing problems in your design somehow? In general, I think they should not be an issue so long as you're properly handling the ready/valid handshaking.

You can't specify a length for write operations as the length is derived from the write data. So just pass in however much data you want to write and the BFM will take care of the rest.

Okay, I got it on handling X's.

So just pass in however much data you want to write , you mean I can write any number of bytes. (Ex : data = 128bytes)

Thanks Alex!!

Yep. Just pass in whatever data you want to write as bytes or bytearray (or something that can be cast to bytes), and it will get split up and re-packed as necessary. If you want to pass in a list of 32 bit ints or something instead of bytes, then there are word access versions as well (write_dwords/read_dwords, etc.)

Thanks Alex!!