-
Notifications
You must be signed in to change notification settings - Fork 11
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
Python code for generating and writing test architecture #85
Conversation
self.bels[bel.name] = bel | ||
|
||
# Add BEL pin | ||
bel.add_pin(name, direction) # FIXME: Opposite direction ?!?!?! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - an input to the site from the tile is an output from the site port bel pin within the tile (think of it a bit like a 'buffer' that brings the signal into the tile)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allright, thanks.
927514b
to
8b67a13
Compare
8b67a13
to
dbdba22
Compare
Testarch generated right now can be combined with gen_device_config.yaml in nextpnr_emit to emit testarch database, but when trying to run wire test, nextpnr fails on assertion in line 150 in arch_pack_io.cc |
|
||
w = site_type.add_wire("MUX_O") | ||
w.connect_to_bel_pin("FFMUX", "O") | ||
w.connect_to_bel_pin("FF", "D") | ||
|
||
w = site_type.add_wire("LUT_OUT", [("LUT", "O"), ("O", "O")]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove wire "LUT_OUT" as there cannot be 2 wires driven by the same output.
This caused nextpnr_emit to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks like a typo in any case as the O
site pin is being correctly driven by the LUT_O
wire anyway: https://github.com/antmicro/python-fpga-interchange/blob/399355e63c3edf9202ca373d371cfa7d1bfa92a4/fpga_interchange/testarch_generators/generate_testarch.py#L82
is_perimeter = y in [0, self.grid_size[1] - 1] or \ | ||
x in [0, self.grid_size[0] - 1] | ||
is_centre = y == self.grid_size[1] // 2 and x == self.grid_size[0] // 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nextpnr_emit expects tile 0,0 to be dummy/null tile.
Also nextpnr_emmit needs some way to inject GND and VCC signals, this is now done by PWR tile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is fair for now - eventually we do want to find a better solution to that
So far this works, testarch capnp is generated and is valid, I'm able to compile it to chip database, and with custom yosys techmaps and flow testarch can pass wire test, but const_wire is still not working. |
fpga_interchange/add_prim_lib.py
Outdated
top_instance_name=None, | ||
top_instance=None, | ||
libraries=libraries) | ||
netlist = LogicalNetlist(name=args.library, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for what appear to be just format changes in existing code that should have been auto-formatted already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments in
1e2ad36
to
86fc80b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -434,7 +437,8 @@ def from_reader(message, | |||
continue | |||
|
|||
if field_proto_data.ref_annotation is not None: | |||
reference_fun = lambda value: reader.reference_value(field_proto_data.ref_annotation, value, root, parent) | |||
reference_fun = lambda value: reader.reference_value( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still slightly confused by these autoformatting changes, but it' passing CI so presumably this format is OK too?
features=["IN_USE", "ZINV_CE"], | ||
callback=lambda m: "BUFHCE.BUFHCE_X{}Y{}".format(0 if m.group(1) == "L" else 1, m.group(2)) | ||
)) | ||
site_thru_features.append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this seems to be just a formatting change unrelated to testarch?
bel_ib.add_pin("I", Direction.Output) | ||
bel_ib.add_pin("P", Direction.Input) | ||
|
||
bel_ipad = site_type.add_bel("IPAD", "IPAD", BelCategory.LOGIC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical for now, but more realistic longer term would be to have one PAD
bel like Xilinx rather than seperate IPAD
and OPAD
bels. This would be useful for testing bidirectional IO away from the complexity of real Xilinx IOBs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, for now, a TODO
comment to not lose track of this might be enough.
This requires a rebase, and I think we can go ahead and merge once CI is green |
Signed-off-by: Maciej Kurc <mkurc@antmicro.com> Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com> Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Add dummy tile on 0,0 location in generate_testarch as populate_chip needs this tile to be empty Add gen_device_config.yaml for testarch Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Fix primitives names to use global names Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Const wire now passes Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
Signed-off-by: Maciej Dudek <mdudek@antmicro.com>
This is a very WIP code that in the end should allow to easily define a test FPGA architecture with timings. Currently it generates and writes site types and tile types, no alternative site types supported.