bl0x / learn-fpga-amaranth Goto Github PK
View Code? Open in Web Editor NEWCode for Bruno Levy's learn-fpga tutorial written in Amaranth HDL
License: BSD 3-Clause "New" or "Revised" License
Code for Bruno Levy's learn-fpga tutorial written in Amaranth HDL
License: BSD 3-Clause "New" or "Revised" License
In part 05, with m.FSM
is used, and fsm.state
is used within the with block. However, this causes an error which states that FSM doesn't have a property state
. If you try to access fsm.state
after exiting the with block, it works.
Also, 05, but not 06 and later, lacks domain="slow"
in the FSM constructor, which I think is incorrect.
I noticed that the LOAD state wasn't being reached even though isLoad was active. Looking at Bruno's code it is using ternary operator to select state which, for Amaranth, I believe you can either use Mux or m.Elif. So, I changed the Execute state from:
with m.If(~isSystem):
m.d.sync += pc.eq(nextPc)
with m.If(isLoad):
m.next = "LOAD"
with m.If(isStore):
m.next = "STORE"
with m.Else(): <-- this overrides because isStore isn't active
m.next = "FETCH_INSTR"
to:
with m.If(~isSystem):
m.d.sync += pc.eq(nextPc)
with m.If(isLoad):
m.next = "LOAD"
with m.Elif(isStore): <---- change is here
m.next = "STORE"
with m.Else():
m.next = "FETCH_INSTR"
which makes it work correctly. However, my mind says that m.If should also work. However, the problem is with the m.Else part. This is being triggered because isStore isn't active which overrides the LOAD state!
The simulations use .add_sync_process()
, which emits a deprecation warning.
I am very new to Amaranth, so I may be missing something, but .add_process()
appears to work just fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.