Conversation
d5c1686 to
55d8d66
Compare
cfd4330 to
13ed24c
Compare
521a310 to
24d5edc
Compare
fb1f110 to
2966160
Compare
24d5edc to
3c9dd65
Compare
2966160 to
f62af1b
Compare
cc9ba47 to
0d17f4c
Compare
f62af1b to
9fd46f9
Compare
cc9ba47 to
cb13674
Compare
3c7c2f2 to
a841075
Compare
cb13674 to
1d7def8
Compare
1d7def8 to
df5ae82
Compare
0705b6a to
157f8b7
Compare
df5ae82 to
a166636
Compare
6c820a4 to
b043367
Compare
ce0173b to
76ca439
Compare
b043367 to
48dc51f
Compare
76ca439 to
e192099
Compare
3b469f4 to
59f362f
Compare
0496b73 to
92729b5
Compare
59f362f to
3e8d89f
Compare
3ea08c8 to
12b0ce1
Compare
1e426ce to
580376d
Compare
580376d to
14583fb
Compare
martijnbastiaan
left a comment
There was a problem hiding this comment.
Nice! My fingers are itching for a registerWb refactor, but that'll have to wait.
| ( Either | ||
| (Index n) | ||
| (Index n, BitVector wordSize, Bytes wordSize) -- Write (index, mask, data) |
There was a problem hiding this comment.
Could you make this a RamOp-like data structure instead of Either?
clash-protocols-memmap/src/Protocols/MemoryMap/Registers/WishboneStandard/Internal.hs
Outdated
Show resolved
Hide resolved
clash-protocols-memmap/src/Protocols/MemoryMap/Registers/WishboneStandard/Internal.hs
Outdated
Show resolved
Hide resolved
| | addrMaxInteger < indexMaxInteger = | ||
| clashCompileError | ||
| [I.__i| Address range (#{addrMaxInteger}) is too small to address all #{indexMaxInteger} words of the register. | ||
|
|
||
| Consider increasing the address width or reducing the number of words.|] |
There was a problem hiding this comment.
Nice! You don't have to change it for this PR, but we should move this check to the memory map verifier. I.e., store how many bits each has on its address bus and then compare it to its stated size. That would give us much better / quicker error messages.
|
|
||
| -- Address calculation: compute index within addressable range | ||
| relativeAddress = wbM2S.addr - offset | ||
| inRange = relativeAddress <= resize (bitCoerce (maxBound :: Index n)) |
There was a problem hiding this comment.
numConvert? It should bubble up the right constraints, which should also eliminate the clashCompileError AFAIK.
There was a problem hiding this comment.
It was a bit of a conscious decision to use clashCompileError instead of adding the constraints.
I was on the fence about whether I'd prefer having an extra constraint for each memory mapped component and I decided the pollution would be larger than the chance you actually deal with address spaces that are too small.
clash-protocols-memmap/src/Protocols/MemoryMap/Registers/WishboneStandard/Internal.hs
Outdated
Show resolved
Hide resolved
firmware-support/bittide-hal/src/manual_additions/addressable_buffer.rs
Outdated
Show resolved
Hide resolved
firmware-binaries/sim-tests/addressable_bytes_wb_test/src/main.rs
Outdated
Show resolved
Hide resolved
4ccca10 to
447503c
Compare
To have a single way of handling wishbone interfaces for memorymapped peripherals
This causes a bug in vivado that makes synthesis use 50gb of ram and take 56 minutes instead of 15
What (what did you do)
This PR introduces a component
addressableBytesWbthat supports adding memory mapped memories such asblockRamsWhy (context, issues, etc.)
To be able to more easily integrate blockRam based components in our
clash-protocols-memmapinfrastructure.Dear reviewer (anything you'd like the reviewer to pay close attention to?)
Regarding the rust side I added a HAL that contains a reference of functionality that I would like to have. What was especially problematic was the alignment requirement for
[u8], or any[[u8; N]]that we use to represent bitvectors. Their alignment requirement is 1 byte, where I require the slice to be 4 byte aligned for efficient copying. I tried to offer an interface to create word aligned byte slices withAlignedArraythat would allow the CPU to perform word sized reads and writes, but am not sure if this is the way to go.We faced a related challenge earlier in the
aximodule, but that was trivially fixed withalign_tobecause it has a streaming interface (we always write to the same destination address).AI disclaimer (heads-up for more than inline autocomplete)
The unit test was mostly written with AI.
TODO
Cross-outany that do not applyWrite (regression) testUpdate documentation, includingdocs/Link to existing issue