-
Notifications
You must be signed in to change notification settings - Fork 10
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
Future ideas and planning #2
Comments
Hi @rodrigomelo9! The decision for adding the board name to the top-level port names comes from the knowledge in the Ada/VHDL communities: explicit is better than failing. You are correct that the board name is already in the directory, and the naming of the directory is non-trivial, since that's used by other projects submoduling this repo. However, when a new board or variant is added, it is a very easy human mistake to forget checking all and each of the ports. Having the board name hardcoded in the constraint files allows finding files copied raw. Otherwise, simulation might succeed and someone might program a board with a pinout that does not match! We absolutely don't want that.
That is trivial, since the board name can be easily replaced with any editor or with We want "changing the board" or "adding support to a new board in an existing HDL project" to require a similar ammount of effort, regardless of which boards you supported already. Typically, the effort for doing so is related to reorganising the sources for moving all device-specific modules out of the core, finding specific hard-ip instantiation replacements, etc. Moreover, port names might not be the same, since we don't enforce that (although it's desirable and we do recommend so). Renaming the board name in the top-level port names is the least of the problems when adding support for a new board 😉! Therefore, this repository is expected to be submoduled and used along with sources organised in four groups:
See, for instance, https://github.com/dbhi/vboard/tree/main/vga. Naturally, each project is free to organise those sources using any structure, and they can use one or many HDL sources (in any language) in each group. However, the overall idea must be preserved. In that conception, adding a new board involves potentially adding sources to Overall, we want this repository to be appealing and used not only by "new generations" of hardware designers (say hackers, hobbyist and software people diving into the lowest level) but also to seasoned hardware designers. The "explicit before implicit" mantra is very important in the hardware industry, and we need to leverage that for good reason. Precisely, all the sources for non open source boards in this repository were donated (copied from) VLSI-EDA/PoC: ucf. And the reference project layout explained above is based on PLC2/Solution-StopWatch. @Paebbels is an expert in VHDL and FPGAs, who authored PoC at the University of Dresden and he is a trainer at @PLC2, as well as the vice-chair of the VHDL Analysis and Standardization Group (VASG, IEEE P1076). This it not meant to be an ad-hominem argument, but for explaining that the workflows proposed here are the result of how these resources were/are taught and used for many years.
This is a different proposal, and I do agree with it; however, as an opt-out feature instead of an opt-in. If data/information is defined in YAML format, we can use anchors and aliases for defining common features in an abstract way, and then build the specific definition of the constraints of each board based on those (while maintaining a declarative approach). Adding/removing the board name when constraint files are generated is trivial, once the YAML data exists. Moreover, at that point, we might avoid having As referenced in the readme, there is already some duplication. Apart from your fpga_lib, Litex/migen/nmigen tools are used in SymbiFlow/Antmicro, and some of those do include the same information provided in this repo. There is also FuseSoC, which might potentially have this repo embedded in the CAPI format/syntax. My current perception is:
There is this nice joke about Europe:
Let's try to build the heaven of open source eda resources by understanding what each of us is good at 😄
I don't think that individual versions are required. I believe that either Yosys or GHDL did not support vectors at the beginning. Therefore, many constraint files for open source boards defined pins individually. However, nowadays I believe that all the tools can handle vectors. Honestly, I did not pay attention to that until now. I was focused on adding constraints for open source boards, and splitting them per interface/port (even though nextpnr does not support providing multiple constraint files yet). Hence, should you be willing to review that, contributions are very welcome! Looking forward, these are my ideas/priorities for this project:
|
I get your point about the board name in each pin name. I was thinking in situations where between boards you only need to change the constraints. For example, imagine something such as using a PMOD in a Zybo and a Zedboard. If pin names in the constraints files are equal (no board name as a prefix) you only need to specify a different constraint file, without any change in the HDL (the same top-level). Of course, for middle-sized final projects could be more difficult, but when developing, I have dealt with such situations several times. Ok about vector versions for less and dip-switches, maybe push-buttons? What about names? LEDS, DIPS (or SWITCHES) and PBS (or BUTTONS)? Regards |
I think vectors should be used as much as possible. Any set of I/O (interface), except the ones with specific signal names (such as VGA or HDMI) should use vectors. From a VHDL perspective, "interfaces" were defined in 2019. Hence, it might make sense to check the naming in https://github.com/VHDL/Interfaces/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc. You will find that Patrick proposed the naming of the interfaces in that repo, so chances are that they will be consistent with the content here 😄. Anyway, I think it is desirable to focus on the YAML or adding new boards first, rather than renaming/fixing the existing constraints now, which will probably be overwritten later. I like @LarsAsplund's "boy scout rule": leave the code slightly better than you found it; but don't spend too much time looking for problems you didn't step into. |
I am interested in the YAML to constraints converter. We need to define the desired YAML file but we have a starting point (boardfile.py). |
Sorry for the late reply. The board name was added by intension. It's part of a bigger set of rules for naming pins in top-level. It might not be obvious to most users why we do it like this, but it reflects some bigger use cases compare to hobbyist usage of FPGA boards. Rules:
Responsibilities of a Top-Level:
If a top-level entity follows these responsibility rules, a truly generic design can be implemented that runs on different boards and even platforms. E.g. I made design running from Virtex-5 to all 7-Series FPGA from Xilinx and also on Stratix II to Stratix V. Only the top-level was exchanged! If this explanation is not yet sufficient enough, we should add an excessive example to demonstrate it. @umarcor ? |
This is my example: https://github.com/dbhi/vboard/tree/main/vga. It's referenced in the README. I think it would make sense to create a site (GitHub Pages) for this repo and add these guidelines there. |
Hi @Paebbels I got the point about the board prefix, and I agree with the rules and top-level responsibilities which you exposed. I applied most of them in my previous designs. The only differences:
Yep, could be great to have the guidelines somewhere. |
@rodrigomelo9 Until now, I never had the need in specifying individual pins as in or out with Directions might be better encoded as:
In this example, the GMII interface is split into 2 sub interfaces for transmit and receive. This also expresses, both partial interfaces are independent from eachother. |
I inherited it from there. I used several times ports such as Yes, it is visible in the interface (entity/module) declaration, but not in the instantiation. Yes, it is visible in the interface (entity/module) declaration, but not in the instantiation. In my opinion, is OK to employ RX/TX to define the direction of interfaces, but not the individual pins. Finally, you can always remove Anyway, I still think that the best option is to have a YAML definition per board, and add the board as prefix, of the direction as suffix when desidered. |
I created a site and moved the content from the README there: hdl.github.io/constraints. |
Hi. Some ideas.
I think that the
boardname_
prefix in each pin name is undesirable:Moreover, the pin names of each board should be identical for the same purpose (for ex, I saw Arty_GPIO_LED[6] and LED0) (in case of leds, swithces and push-buttons, maybe we can have the individual and vector versions).
The text was updated successfully, but these errors were encountered: