-
Notifications
You must be signed in to change notification settings - Fork 177
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
platform.add_clock_constraint does not work for instances with lattice diamond for machxo2 #546
Comments
What is the error you're getting? |
in
|
It probably doesn't like the |
How can I constrain it then? |
cd_sync = ClockDomain()
platform.add_clock_constraint(cd_sync.clk, freq) |
Thanks that works. Somehow it doesnt work for my non minimized use case :(. I will try to find another (less minimized) example |
This also doesnt work, probably due to hierarchy: from nmigen import *
from nmigen.build import *
from nmigen_boards.tinyfpga_ax2 import *
class Test(Elaboratable):
def elaborate(self, plat):
m = Module()
m.submodules.jtag = JTAG()
return m
class JTAG(Elaboratable):
def elaborate(self, plat):
m = Module()
cd_sync = ClockDomain("sync")
m.domains += cd_sync
plat.add_clock_constraint(cd_sync.clk, 2e6)
plat.add_resources([Resource("gpio", 0, Pins("1", conn=("gpio", 0), dir="o"), Attrs(IOSTANDARD="LVCMOS33"))])
gpio0 = plat.request("gpio", 0)
m.d.sync += gpio0.eq(~gpio0)
m.submodules.inst = Instance("JTAGF", o_JTCK=cd_sync.clk)
return m
TinyFPGAAX2Platform().build(Test()) the error is
|
The second one is a very serious issue, and one we can already fix (the |
Sadly I am not at all good with diamond but I will try my best. |
I am not good with it either. I'm just persistent enough that eventually I fix this stuff when it becomes my responsibility. |
Okay according to some microsemi guide to synplify pro you have to use "." as a hierarchy seperator jUsT iN SdC FiLeS. Should i file a PR that fixes that? |
Yep. |
Or maybe use |
The first example really works when we escape $ with a \ in front of it as @cr1901 suggested :) |
Tested. Works |
Testing with 028d5d8: this is still a problem. The issue isn't related to hierarchy. It is caused by the
To see how Tcl performs this escaping, consider:
For some reason, It looks like the only option is to use the weird inconsistent escape scheme that Diamond seems to require. Sadness. |
After further testing, Diamond also requires the clock to be specified using the canonical net, i.e. after bypassing all the aliases ( |
Partially addresses amaranth-lang#546.
Partially addresses #546.
Similiar to #373 platform.add_clock_constraint does not work for instances in lattice diamond.
However, the same fix does not seem to be applicable. Do you have any ideas what is going wrong?
repro:
The text was updated successfully, but these errors were encountered: