Skip to content
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

Support LUTRAM mode in FPGA fabric #1471

Open
chungshien opened this issue Dec 4, 2023 · 7 comments
Open

Support LUTRAM mode in FPGA fabric #1471

chungshien opened this issue Dec 4, 2023 · 7 comments
Assignees

Comments

@chungshien
Copy link
Collaborator

chungshien commented Dec 4, 2023

We would like to support LUTRAM mode, where CLB can be configured to dual-port RAM.

This feaure uniquely exposes the structure of config bits to the customer, we need to enhance OpenFPGA so that customer's view align with OpenFPGA's.

Few changes are needed.

Change 1
For QL Memory Bank Flatten BL/WL configuration mode: fix the WL size for CLB tile to be 32bits. Existing OpenFPGA will try to keep BL and WL in a square shape if possible (with BL might be one bit bigger than WL in some cases)

Change 2
(I am middle to understand other changes, will update more)

Describe the solution you'd like

Change 1

  1. In architecture XML, introduce "num_wl" attirbute when we declare "pb_type" element
  2. This attribute is optional, only special case like this need to specify "num_wl" attirbute, in this case set to 32
  3. Eventually this attribute value will be stored/trasnferred as new variable "num_wl" introduced in t_physcial_tile_type class. By default the num_wl is 0 (hence the XML attribute is optional):

If it is 0, OpenFPGA will maintain square shape BL vs WL if possible (original code)
If it is non-0 (positive number), OpenFPGA will use it as hardcoded size as WL size

  1. During build_physical_tile_module(), OpenFPGA will determine BL and WL size based on what had been desscribe in (3)
  2. Only physical tile will be affected, other module building code (routing, grid etc) will not be impacted
@chungshien
Copy link
Collaborator Author

@tangxifan

FYI, this is something we planned to do.

I created the issue so that you can have early review.

Please comment if you have any concern.

@chungshien
Copy link
Collaborator Author

@alaindargelas

@tangxifan
Copy link
Collaborator

@chungshien @alaindargelas

I believe this is a good starting point to support LUTRAM.
It is very reasonable to allow users to customize the size of BL/WL per block. However, I do not suggest to add them to the VPR architecture XML, which is designed for a logical/abstract -level representation.
Instead, it should appear in OpenFPGA's architecture description language.
A proper location to add the support is the fabric key file.
For example,

<fabric_key>
  <module name="grid_clb" num_wls="32">

@tangxifan
Copy link
Collaborator

@chungshien @alaindargelas
My vision is that the fabric key will offer these detailed customization in future. We will keep add more syntax to allow designers to customize any corner of their FPGA. The OpenFPGA's architecture file provides a high-level but rather general description.

@chungshien
Copy link
Collaborator Author

Hi @tangxifan

Thanks for reviewing. Any other place to put this info?

For us, we no longer use fabric_key.xml

So if possible, I would like to avoid fabric_key.xml, but if you really think this is the ONLY BEST way to do so, then I will look into it.

How about openfpga.xml

We can define it within "configuration_protocol", since this affect configuration bits arrangement.

image

@chungshien
Copy link
Collaborator Author

(@tangxifan @alaindargelas)

I had moved the original XML code from VPR architecture XML (originally suggested by Dana) to Openfpga architecture XML (suggested by Xi Fan)

I could see one extra benefit by doing so (even though the coding is more complex):

  • I only need to PR to OpenFPGA repo
  • Instead of PR into both OpenFPGA and vtr-verilog-to-routing repo

Latest code is committed into a branch via chungshien@df5ce25

Once PR #1566 is approved and merged, I could immediately PR to support this LUTRAM feature.

One thing to note: Xi Fan is suggesting define the support in fabric_key.xml, which our company is no longer using it. So in my latest code, I am doing it in openfpga.xml (see my previous comment). Example of XML would be

image

@alaindargelas
Copy link

@ganeshgore for review too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants