How to correctly write top module with multiple modules and I/O ports #1476
Replies: 3 comments 4 replies
-
I have one main piece of feedback on style, which is that Python uses (by convention) capital letters for constants. This made the code hard to read for me, as I would keep thinking that local variables are actually constants, and it was very confusing.
You can do it like this. Another option is to put everything into the
Use
See this section of the language guide.
I'm not sure I understand the question.
In this particular case, I will advise to keep everything in the same clock domain and use Either way, I see it that CDC must be avoided unless absolutely necessary by the design, since this eliminates entire classes of errors upfront; and if done, (Apologies, didn't mean to close the discussion--I keep hitting Shift+Enter somehow.) |
Beta Was this translation helpful? Give feedback.
-
I understand, I need to reformat the style I have written the code in, I used ALL Caps for constants similar to Verilog, and I should rename the local variables to lowercase letters, I also saw that generally the module names have capital letters
After reading the part about changing clock domains in a submodule, the question I asked, overall doesn't make sense.
So I should add an |
Beta Was this translation helpful? Give feedback.
-
I know you have already answered the question about the PLL. But having tried that I have a problem still. I used the Uart module that I know is working normally with 25MHz base clock, and used the ecp5pll.sv to create an 80 MHz clock with that i upped the CLKS_PER_BIT accordingly. But still the UART doesn't give me the correct LED pattern when I press different keyboard inputs in a serial terminal. Do I need to declare the clock domain also in the uart submodule?
|
Beta Was this translation helpful? Give feedback.
-
Hello
I have written lots of modules by themselves in Amaranth and now I need to write the top module that puts them all together. I tried doing it, but ran into some questions. Here is what I have written so far:
Is this the best way to instantiate and use other modules in the top module?
How to access connectors(for example I am using the ulx3s board)?
How to change the Clock Domain of a submodule, and when trying to instantiate the modules should I use
m.d.comb
orm.d.sync
? For example the PWM module should use the clock from CIC(CIC1_out_clkSin)Beta Was this translation helpful? Give feedback.
All reactions