Comments (10)
This crossbar doesn't implement WB classic. It implements the WB pipelined, found in the B4 spec of the Wishbone protocol. A request is made therefore every time STB && !STALL, and STB is not allowed to drop if STALL is active (unless CYC also drops ...). STB and ACK are also separate. STB may remain active as long as you wish to continue making requests of the slave (and CYC is high), and you should receive one ACK per cycle where (STB && !STALL).
If you wish to convert between WB classic and WB pipelined, please examine the wbp2classic.v or wbc2pipeline.v
You will likely find that WB pipelined is many times faster than WB classic--especially when accessing any DRAMs, where the speed difference may be 20x or more.
You can read more about the Wishbone properties the crossbar was built to adhere to here.
Dan
from wb2axip.
Thank you for the quick response. I'm also using WB pipelined. As you'll see in the waveform, the WB slave port (user_port) uses a STALL signal. The STALL signal is low when ACK is asserted, so STB is allowed to drop. However, STB does not drop, which causes the slave to reassert STALL the following clock cycle.
from wb2axip.
When using WB classic, the bus cycle ends and STB drops following an ACK.
When using WB pipelined, a request is made once STB && !STALL. If you hold STB high any longer, you are making a second request. This is entirely independent from the ACK signal. There may be many clock cycles between STB falling and the first ACK return. This is unique to WB pipelined.
Looking over your trace, I'm struggling to follow your naming conventions. Are the user_port_wishbone* signals the incoming ports to the crossbar? If so, I see STB && STALL (request is made, but not yet accepted), STB && !STALL (request is accepted), followed by STB && STALL again (a second request is being made, but not yet accepted). This latter STB request is then dropped (bus abort), suggesting you didn't mean to make two requests? How is the crossbar then wrong for forwarding your two requests downstream and then aborting the second request?
Dan
from wb2axip.
I ran out of time yesterday. Apologies if I wasn't making myself clear.
In the trace below you see 3 signal groups:
- The Bus Master issuing a single word transaction, using WB pipelined protocol. The Bus Master is attached to wbxbar port 2.
- Wbxbar forwarding this transaction to the slave, attached to port 7.
- The relevant Wbxbar input and output ports.
My question is, on the slave port, why is STB still asserted on the clock cycle following the ACK? The Bus Master that initiated the transaction only issued a single transaction (STB && !STALL high for one clock cycle).
Thank you for looking into this.
from wb2axip.
If you can provide a test bench that recreates this issue, or alternatively the slave address and slave address mask registers, then I should be able to generate a test to duplicate this issue.
from wb2axip.
Basically, the roadmap forward will be to look at the o_sstb signal and try to back trace it through all of its steps from where it leaves the design (broken) to where it enters the design (according to your trace) to see what's going on. This can be done easily in simulation, since you have access to all of the signals within a simulation. Alternatively, we can do the same using hardware--but that tends to be much harder. Hence, to debug this, I'd like to figure out how to repeat this problem in a way that it can then be debugged.
Dan
from wb2axip.
Agreed. I'll dig in, see what I can find and report back here. It'll be a good exercise.
My current simulation is quite involved, including an Ibex CPU, LiteDRAM memory controller, etc. I'll try to reduce to a simpler testbench that's easier to hand over.
from wb2axip.
I found the issue, or at least part of it. The issue is in my code. Due to a logic error, the bus master was generating an STB pulse of 2 clock cycles wide (in the absence of STALLs) for a single-word transaction. A pretty obvious bug. What threw me for a loop was that you don't see this in the Verilator trace. In the screenshot above (the verilator trace) you see an STB pulse of one clock cycle wide.
When I simulate this bus master using Icarus Verilog, I get a different picture:
So, lesson learned. Sometimes you have to question the sanity of the trace itself. I started to suspect the trace when I noticed that in the Verilator trace, the address decoder's i_valid and o_valid go high on the same clock edge, which doesn't make sense when OPT_REGISTERED is set:
I'm probably doing something wrong in the way that I'm generating the Verilator trace. I haven't figured that out yet.
As you probably expected, wbxbar is working just fine. Thank you for taking the time to respond. I'm closing the case.
from wb2axip.
Sigh.
Yes, this is one of the problems I've come across with Verilator. I discuss it in my Verilog tutorial.
My standard answer is to update values off-clock tick--perhaps 80% of the way through the clock cycle or some such. This will allow you to "see" what's going on.
A "better" answer that I've been considering would be to do the task properly: 1) calculate values to set any clock-synchronous things to prior to setting the clock high--but don't set them, then 2) set the clock high, 3) call eval(), 4) set your values (i.e. anything synchronous to the clock tick)--but set them based upon what you recorded their values should've been based upon conditions prior to the clock tick, 5) call eval() again, and 6) finally, and only then, step the clock forward. This, I think, is the "right" answer--I'm just not doing it (yet).
Dan
from wb2axip.
I was already sampling both rising and falling clock edges. I now tried 'oversampling' 8x and I indeed see the STB pulse stretching out further, not quite to 2 clock cycles, but to 1.5. A bit strange, but good enough as an indication that something's wrong there. Too bad my simulation now runs 4x more slowly...
Thanks for the great info!
/Ruben.
from wb2axip.
Related Issues (20)
- Vivado Block design, local param, and axixbar HOT 2
- Possible enhancement: add AWCACHE parameter to axis2mm HOT 2
- `default_nettype none breaks vivado global synthesis HOT 10
- Enhacement: Sync only on TLAST option for axis2mm HOT 10
- Is the OPT_NONESEL option currently the same as the multiple slaves? HOT 1
- File 'faxi_valaddr.v' is missing HOT 1
- Missing LICENSE file HOT 3
- Question regarding AW / W channel dependencies HOT 8
- Whether the situation crossing 4K boundary has been handled in AXIDMA? HOT 2
- axim2wbsp.v: has different data endianness for write and read channels HOT 1
- axisafety.v in ZYNQ Ultrascale+ works for read operations, but not for write operations HOT 11
- is the axiclk can be used in the axi lite scenario HOT 4
- Why does the axixclk module has no wid input/output? HOT 2
- Arbitration Behaviour of axixbar HOT 4
- the patreon support HOT 2
- something went wrong (I guess : the version of tools) HOT 1
- fusesoc file based on CAPI 1 standard. HOT 2
- variable 'M_AXIS_TDATA' should not be used in output port connection axivfifo.v":792 HOT 1
- AXILUPSZ has the wrong shift for WSTRB
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wb2axip.