error propegating clock domain #1527
Replies: 4 comments 2 replies
-
RFC 59 suggests the following way:
|
Beta Was this translation helpful? Give feedback.
-
Thank you @zyp for the pointer to RFC 59. I hacked at the code a bit, and found a fix that is mostly a guess, but it does load the code with this change. The process used by @bl0x when he wrote his code appears to be step 3 in the
To get amaranth to run the code, I have to replace the += with an = from the ClockDomain assignment in the Clockworks class. I'm not too sure how correct this is, but it works for the blinking led example in this Q & A. The
I will pass this on to @bl0x in case it is a typo. |
Beta Was this translation helpful? Give feedback.
-
A question, how is this different If you have a moment, I could really use some pseudo code to understand what you mean by creating the domain in the outer module. |
Beta Was this translation helpful? Give feedback.
-
It probably is completely broken. I have been hacking without
understanding. It will take me a while to get up to speed. Thanks for the
code pointer. I will try it out.
All the best,
Chris
…On Mon, Oct 7, 2024 at 1:01 PM Catherine ***@***.***> wrote:
Something like this:
class ClockResetGenerator(Elaboratable):
def elaborate(self, platform):
m = Module()
m.d.comb += ClockSignal("sync").eq(...)
return m
class Toplevel(Elaboratable):
def elaborate(self, platform):
m = Module()
m.domains += ClockDomain("sync")
m.submodules += ClockResetGenerator()
return m
Your example of m.domains = ... seems completely broken, i.e. it should
be a syntax error. It reassigns an internal variable in a way that
shouldn't be done.
—
Reply to this email directly, view it on GitHub
<#1527 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG76X44XCZTHPGW5S6Q3RODZ2K46ZAVCNFSM6AAAAABPQJ23SKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBXGA4DINQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***
.com>
|
Beta Was this translation helpful? Give feedback.
-
Hello,
First off apologies for not having a minimum working example.
I'm very new to amaranth and would like an opinion on how to properly propagate the domain of a clock module. I'm using Amaranth 0.5.2 on an arch Linux system with Python 3.12.
I am using a tutorial I found to try to learn Amaranth and eventually build a risc-v processor on https://github.com/bl0x/learn-fpga-amaranth . I call a python script to initiate the build and j-tag steps for the FPGA. To run it I call
python boards/digilent_cmod_a7.py 2
. This runs the second step in the build process for the FPGA, which is a blinking lite demo.The following is the code for
boards/digilent_cmod_a7.py
and the next file is the code for
top.py
.These two files select the
02_slower_blinky/soc.py
file to build. Thesoc.py
file loads theclockworks.py
. These files are the two I'm most concerned with as they don't seem to run properly when trying to propagate the domain of the clock domain defined inclockworks.py
.The following is the code for
02_slower_blinky/soc.py
and finally the following code is for
clockworks.py
Running
boards/digilent_cmod_a7.py 2
gives me the following error.The code that causes the error is the line with
m.submodules.cw = cw
from02_slower_blinky/soc.py
. If I editamaranth/hdl/_ir.py
, with the following patch, I can get this to build, but I believe it to be luck rather than knowing what's going on.I would appreciate any ideas on how to fix this in my code without my hacking at amaranth as I have.
Thanks
Chris
Beta Was this translation helpful? Give feedback.
All reactions