whitequark changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings on Mondays at 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 276 seconds]
Degi_ is now known as Degi
<_whitenotifier-8> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/nextpnr/compare/37b758ee7380...b3ddd07891ac
<_whitenotifier-8> [YoWASP/nextpnr] whitequark b3ddd07 - Update dependencies.
bl0x_ has joined #amaranth-lang
bl0x has quit [Ping timeout: 250 seconds]
kivikakk has quit [Killed (NickServ (GHOST command used by asherah[m]!~asherahhr@2001:470:69fc:105::3:5259))]
kivikakk1 has joined #amaranth-lang
kivikakk has joined #amaranth-lang
FFY00_ has quit [Remote host closed the connection]
Stary has quit [Ping timeout: 260 seconds]
FFY00 has joined #amaranth-lang
Raito_Bezarius has quit [Ping timeout: 252 seconds]
Stary has joined #amaranth-lang
Raito_Bezarius has joined #amaranth-lang
peepsalot has quit [Ping timeout: 265 seconds]
SpaceCoaster has quit [Ping timeout: 252 seconds]
SpaceCoaster has joined #amaranth-lang
SpaceCoaster has quit [Ping timeout: 250 seconds]
SpaceCoaster has joined #amaranth-lang
chaoticryptidz has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<whitequark> oh, looks like crosslink-nx board has shipped
antoinevg[m] has quit [Quit: You have been kicked for being idle]
<josuah> it took a bit of time, but came through!
<josuah> still living in the middle of crates? could gater enough time to settle down after moving in?
<whitequark> somewhat in the middle of crates
<whitequark> i'm in between of GPs and really need meds adjusted, so it's annoying rn :/
kivikakk has quit [*.net *.split]
jess has quit [*.net *.split]
lambda has quit [*.net *.split]
kmehall has quit [*.net *.split]
jfng[m] has quit [*.net *.split]
smkz has quit [*.net *.split]
Lord_Nightmare has quit [*.net *.split]
TD-Linux has quit [*.net *.split]
crzwdjk has quit [*.net *.split]
V has quit [*.net *.split]
kmehall_ has joined #amaranth-lang
lambda has joined #amaranth-lang
crzwdjk has joined #amaranth-lang
V has joined #amaranth-lang
jess has joined #amaranth-lang
Lord_Nightmare has joined #amaranth-lang
kivikakk has joined #amaranth-lang
smkz has joined #amaranth-lang
jfng[m] has joined #amaranth-lang
TD-Linux has joined #amaranth-lang
antoinevg[m] has joined #amaranth-lang
peepsalot has joined #amaranth-lang
<josuah> hang-on tight! >_<
<d1b2> <pln> Hi Folks I'm looking into the riscv. https://github.com/bieganski/mtkcpu
<d1b2> <pln> It states that it support openocd/gdb. It contains a jtag block, but I haven't figured out howto connect to it using openocd. I guess you need to setup openocd to use ftdi bitbanging the jtag of the target RISC-V.
<d1b2> <pln> (I'm on an icebreaker fpga, running linux (arch).)
<d1b2> <pln> There is a sample gdb config file, but haven't found any sample openocd file for it.
<josuah> @pln: not sure about anything, but https://lib.rs/crates/wishbone-tool mentions GDB vor RISC-V in the context of LiteX. Not Amaranth, but still...
<d1b2> <pln> Thanks will look into that.
<josuah> I am also wondering if anyone already uses something to access an FPGA internal bus (such as Wishbone) from USB
<josuah> or eventually SPI, UART, whatever else
<josuah> the only thing I saw was that wishbone-tool from LiteX and individual initiatives such as https://zipcpu.com/blog/2017/06/05/wb-bridge-overview.html
<d1b2> <pln> I looked briefly, I think they solve a bit another problem.
<d1b2> <pln> There is already a "transport" in place. I just wanna let openocd know about it.
<josuah> @pln: oh right! not debugging the same segment...
<d1b2> <pln> Actually there are two problems here.
<d1b2> <pln> 1st) configuring openocd to use the correct gpios for the bit banging.
<d1b2> <pln> 2nd) knowing what the correct pins would be.
<d1b2> <pln> openocd docs are blurry. I don't understand, they refer to some bitmask but not how its setup.
<d1b2> <pln> The second part is also blurry, my understanding of the pin mapping in Amaranth is close to 0.
<josuah> @pln: that might be a very good question for OpenOCD, at least some part of the answer is there
<josuah> I mean #openocd
<josuah> in case you do not have much luck here
<josuah> Is that not just a regular JTAG debugger that you are after?
<josuah> Ah #openocd is on libera.chat
<josuah> I cal help with a bit of each part, about Amaranth, I'll start here:
<josuah> one reason why I really like Amaranth is its powerful yet simple hardware support tools
<josuah> simply because it has conventions on how to do something, then everyone wishing to contribute can use this common language
<josuah> are you interested in hardware pins or your CPU core pins?
<d1b2> <zyp> the wishbone-tool debug functionality is vexriscv specific
<d1b2> <zyp> mtkcpu says it's compatible with the standard risc-v debug spec, so I'd expect a fairly standard risc-v openocd config should work
<d1b2> <zyp> but I'm no openocd expert 🙂
<josuah> maybe it is more about finding an adapter that works well in OpenOCD, the GD32VF103 (as in sipeed longan nano) use standard RISC-V debugging with JTAG iirc, if you have one, you could try to use it as a way to configure the tooling, then switch to the soft RISC-V core
smkz has quit [Quit: smkz]
smkz has joined #amaranth-lang
<josuah> @pln: on something like Verilog and several other languages, you would have an architecture-specific configuration file, such as .pcf for iCE40, that would allow you to do mapping between the package pin number and names that can immediately be used in the HDL of choice
<josuah> on Amaranth, this is what Pin() roughly provides: a way to access the hardware pins as HDL signals
<josuah> but this is not how board definitions are done, which is where all hardware definitions are done:
<josuah> pins are always going to PCB traces, then eventually to other chips using some protocol, or an external connector
<josuah> Amaranth allows to group the pins together in Connectors, which then allow you to tell "pin 3 of connector 1": it does the mapping with the FPGA chip for you: no more need to lookup the board pinout reference over and over to figure the right pinout
<josuah> since connectors are now very portable (able to just swap the connector name, the pin number withint that connector are the same), it is further possible to give every pin a name within that connector
<josuah> for instance, if it is a connector for a standard protocol, present on some board, the board itself can set the naming for that connector
<josuah> then, from the FPGA HDL author point of view, it is possible to request "give me the Ethernet/USB/... interface", and you would get the right pins, organized together with subsignals with human-readable names
<josuah> so what you would need to do as an FPGA HDL author is to lookup on your board definition file what resources are available (named Resource() in the board definition), and see if you notice your connector/component/... in here
<josuah> for instance, for the ICEBreaker board, you have a list of resources of all kinds: https://github.com/amaranth-lang/amaranth-boards/blob/main/amaranth_boards/icebreaker.py#L16-L63
<josuah> the very different names are just the many different kind of resources with standardised pinout, but they work the same way
<josuah> this files gives the equivalencies between the pin numbers and the human friendly named resources types that you can grab to build a project out of it
<josuah> if your resource appears to already have a wrapper for it, such as LEDs, you can use them in your project with platform.request("led_r") for the red led, and you would have a Signal out of it, that you can use in Amaranth
<josuah> If you do not see a ready-made Resource() for what you need, you can build yourself one by adding it to your platform in your HDL files, just like it was done here: same syntax, just nothing in the default resources was fitting so adding one more
<josuah> for instance, here is how, in a small demo project, I grab a PMOD connector, take just one pin out of it, and give it a custom "rx" name: https://github.com/josuah/pico-ice-pmod/blob/main/amaranth/main.py#L84-L85
<josuah> it is later requested like any other resource here: https://github.com/josuah/pico-ice-pmod/blob/main/amaranth/main.py#L29
<josuah> and I can access it as a nice and organized resourcename.signalname like here https://github.com/josuah/pico-ice-pmod/blob/main/amaranth/main.py#L38
<josuah> sorry for the very lengthy paragraph!
<josuah> -- END OF AMARANTH PINOUT DOC --