-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 8/16/32 bit widths for block RAM inference #32
Comments
I started to have a look at this issue. Since I am a complete newbie to this project I am just going to state my understanding so far and then you will have to correct me if I am wrong. As this concerns Xilinx 7 series block RAMs a useful read up on what BRAM primitives the device actually support would be the 7 Series FPGAs Memory Resources UG. The rules file Techmap maps to one of the modules available in Also I should run some examples and examine the IR. |
@markus-zzz The Yosys manual might also be useful. The mapping for 8/16/32-bit widths are easier than 9/18/36-bit widths, because you don't use the parity bits {DOP,DIP}. The The shifter tests use the RAM as a double buffer with the switches as input and the LEDs as output, SW0 flips the buffers.
|
@HackerFoo, Thanks! I had a look at the Yosys manual before and it contains a lot of useful background info. I am still a bit confused though about what to do. In
I.e. we need to match the declared port sizes and for 32/16/8 this is trivial map-through. If I do this wrong will I get any warnings or errors from the toolchain (yosys or nextpnr) or will I see problems first when I try to run it on HW? Is it possible to simulate this? (Maybe if I borrow the Xilinx primitives from a Vivado install?) The board is the second problem, the only Xilinx 7 series device that I have is a ZedBoard and I am not sure that is supported right now. |
Can I help with this issue? |
I found the After reading the UG for 7 Series BRAM it's also not clear to me if setting the width to 9, 18, 36 (and then not using the parity bits) densely packs the memory. I'll keep reading and write some tests to check. |
From what I remember, there are really only widths that are multiples of 9 bits in hardware (8 bits from DO + 1 bit from DOP), and one of those bits can be used for parity. In addition there are modes that handle 1, 2, and 4 bits, but cannot use the parity bit. So 2^n bit widths without parity just waste the 9th bit (DOP). The structure of the hardware is interesting, in that a BRAM18 is made of mostly symmetric halves, where each has a port, and then two of those can be used together as a BRAM36. This might give you an idea of how memory is arranged in the two BRAM18s that make up a BRAM36: https://github.com/SymbiFlow/symbiflow-arch-defs/blob/master/xc/common/primitives/bram/rambfifo36e1.pb_type.xml#L236-L387
|
I read the UG yesterday and came to the same conclusion. There were also some lower bit modes (1, 2, 4 I think) but they didn't seem relevant for now. Thanks for the arch defs link. |
Add inference for 8, 16, and 32 bit wide block RAM.
brams.txt
brams_map.v
to correctly map {DO,DI} to {A1,B1}DATAhttps://github.com/HackerFoo/yosys/commit/13af5854ce244281da05fdf64e57054c6941e41d#diff-f6a92cf62e16c847b9dc035993276826L48
yosys/techlibs/xilinx/brams_map.v
Lines 164 to 165 in 5f900f7
The text was updated successfully, but these errors were encountered: