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

Add generative IOs #253

Draft
wants to merge 5 commits into
base: FABulous2.0-development
Choose a base branch
from

Conversation

EverythingElseWasAlreadyTaken
Copy link
Collaborator

Adds a GEN_IO primitive to generate IOs in the top level design and
route them trough to the defined tile, where they are connected to
the switchmatrix.

GEN_IOs can be used as following in the fabric.csv:
GEN_IO,Number of Pins,Direction,Prefix

GEN_IO,2,OUTPUT,A_O,,,,,,,,,,,,,,
GEN_IO,2,INPUT,A_I,,,,,,,,,,,,,,

This will generate four IOs, two INPUT (A_I0, A_I1) and two OUTPUT(A_O0
and A_O1), which can be a accessed in the tile through the switchmatrix.
This will also generate four external ports, (A_I0_top, A_I1_top,
A_O0_top, A_O1_top) which are routed to the top level and are connected
to the equivalent tile ports.

Adds a GEN_IO primitive to generate IOs in the top level design and
route them trough to the defined tile, where they are connected to
the switchmatrix.

GEN_IOs can be used as following in the fabric.csv:
GEN_IO,Number of Pins,Direction,Prefix

``` fabric.csv::
GEN_IO,2,OUTPUT,A_O,,,,,,,,,,,,,,
GEN_IO,2,INPUT,A_I,,,,,,,,,,,,,,
```
This will generate four IOs, two INPUT (A_I0, A_I1) and two OUTPUT(A_O0
and A_O1), which can be a accessed in the tile through the switchmatrix.
This will also generate four external ports, (A_I0_top, A_I1_top,
A_O0_top, A_O1_top) which are routed to the top level and are connected
to the equivalent tile ports.

Signed-off-by: Jonas K. <[email protected]>
Adds the CONFIGACCESS flag to GEN_IO which allows us to generate
config access bits directly for a tile.

``` fabric.csv::
GEN_IO,2,OUTPUT,C_,CONFIGACCESS,,,,,,,,,,,,,
```
Will generate 2 config access bits for this tile, that will be routed to
Top.

Signed-off-by: Jonas K. <[email protected]>
Add inverted feature, to invert a GEN_IO.

``` fabric.csv::
GEN_IO,2,OUTPUT,A_O_,INVERTED,,,,,,,,,,,,,
```

Will generate 2 Output ports for the fabric, that are inverted.
Can be also used with config access:

``` fabric.csv::
GEN_IO,2,OUTPUT,C_,CONFIGACCESS,INVERTED,,,,,,,,,,,,
```

Signed-off-by: Jonas K. <[email protected]>
Add AddRegister command to VHDL and Verilog writer, which adds a
Register.

Add clocked feature to GEN_IO, which adds a register to GEN_IO.

``` fabric.csv:
GEN_IO,2,OUTPUT,A_C_,CLOCKED,,,,,,,,,,,,,
```
Adds two clocked output GEN_IOs to a tile.

Convert GEN_IO docsting to new format.

Signed-off-by: Jonas K. <[email protected]>
@EverythingElseWasAlreadyTaken EverythingElseWasAlreadyTaken marked this pull request as draft November 21, 2024 11:53
@EverythingElseWasAlreadyTaken
Copy link
Collaborator Author

@KelvinChung2000 Please no squash merge on this, since there are a lot of change, so it would be good to keep the commits separated, for a better traceability and to keep the commit messages.

Add documentation for generative IOs

Signed-off-by: Jonas K. <[email protected]>
Copy link
Collaborator

@KelvinChung2000 KelvinChung2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we will no longer need the W_IO tile with this? Maybe should also update the demo to use the feature.

@@ -21,6 +22,8 @@ class Tile:
The list of ports of the tile
matrixDir : str
The directory of the tile matrix
gen_ios : (List[Gen_IO])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not need bracket

@@ -35,6 +38,7 @@ class Tile:
portsInfo: list[Port]
bels: list[Bel]
matrixDir: pathlib.Path
gen_ios = list[Gen_IO]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ":"

@@ -108,20 +108,38 @@ def addLogicStart(self, indentLevel=0):
def addLogicEnd(self, indentLevel=0):
self._add("\n" f"end" "\n", indentLevel)

def addAssignScalar(self, left, right, delay=0, indentLevel=0):
def addRegister(self, reg, regIn, clk="CLK", inverted=False, indentLevel=0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For large text templates, I think putting the text at the top and then using .format should make things look cleaner. We can do this sort of "cosmetic" update later

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding information about the created port still needs information would be useful.

@EverythingElseWasAlreadyTaken EverythingElseWasAlreadyTaken marked this pull request as draft December 6, 2024 15:31
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

Successfully merging this pull request may close these issues.

2 participants