whitequark[m] changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://freenode.irclog.whitequark.org/nmigen
<whitequark[m]> Degi: some configuration of openocd is necessary
<lkcl> Degi: we just set up a page which documents this, i have a FT232 here and wired it up to C4M-JTAG
<lkcl> slightly different but we researched the source code of openocd directly
<lkcl> there are "default" patterns (RX->TDI etc. etc. something like that) which if you obey *exactly* that configuration you do not have to change anything in openocd.cfg
<lkcl> search this page for the words "FT232R GPIO bit number" https://libre-soc.org/HDL_workflow/ECP5_FPGA/
<lkcl> if you choose to match EXACTLY those GPIO allocations on the FT232, you can then follow this diagram:
<lkcl> disconnecting the 3.3v-5.0V jumper entirely is CRITICALLY IMPORTANT
<lkcl> do not under ANY CIRCUMSTANCES try to have the power from the FPGA supplied *to* the FT232 at the same time as connecting the jumper which also supplies power from an on-board regulator
<lkcl> you absolutely must let the *FPGA* provide the VREF (Voltage Ref) *to* the FT232 so that the FT232 knows what the CMOS levels are
<lkcl> do not be tempted - at all - to think "oh the FPGA supplies 3.3v, the FT232 on-board regulator supplies 3.3v, therefore what's the big deal?"
<lkcl> the Big Deal is: one will be 3.31v (fluctuating), the other will be 3.20v (fluctuating) and you get a current fight between the two
<lkcl> one or both will lose that fight, and the Magic Smoke Genie will leave either (or both) devices
<lkcl> btw if you need to do something that's so low-level you don't even have a "target" (no pre-defined CPU as specified in openocd's configs), you can use something like this:
<lkcl> that's setting the interface to ft232, then the baud rate to 5khz (because i have 12 in dangling wires with no GND ribbon cable in between each signal)
<lkcl> then i have C4M JTAG set up with an ir width of 4, etc. etc.
<lkcl> it's a pretty basic bare-bones config.
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 252 seconds]
Degi_ is now known as Degi
_whitenotifier-3 has joined #nmigen
<_whitenotifier-3> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JO69h
<_whitenotifier-3> [YoWASP/yosys] whitequark b2f4bd1 - Update dependencies.
fevv8[m] has joined #nmigen
thorns514 has quit [Quit: Textual IRC Client: www.textualapp.com]
Bertl_oO is now known as Bertl_zZ
jeanthom has joined #nmigen
jeanthom has quit [Ping timeout: 265 seconds]
revolve has quit [Ping timeout: 245 seconds]
revolve has joined #nmigen
chipmuenk has joined #nmigen
chiastre has quit [Remote host closed the connection]
chiastre has joined #nmigen
<Degi> lkcl: Neat, so I can just use a FT232H chip with that? I don't intend to use an adapter but the chip itself on a custom PCB, so the chip doesn't need to be specially configured to do JTAG but rather OpenOCD will do that for me? (For example on the ECP5 EVN board the FT2232 chip is connected to an EEPROM, I wondered what that is for)
<Degi> Oh, is that an FT232R? That can do JTAG?
<Degi> Yes, that looks good... So OpenOCD directly drives the GPIO and doesnt need any extra configuration...
<hell__> not sure if R variants can do JTAG (they do not support USB 2.0, which may be a bottleneck)
<agg> the ft232h is the usual choice i believe, then openocd doesn't need to wiggle gpio directly, the chip understands jtag (and spi and uart) natively
<lkcl> Degi: they do UART and they can be put into direct bit-banging mode (general purpose)
<agg> or 2232h, then you can have a usb-uart and usb-jtag at the same time
<lkcl> agg: neat!
<agg> (or usb-fifo and usb-jtag, which can be nice if you want a higher bandwidth pipe out of an fpga)
<lkcl> agg: i got a DTD Tech FT232R off of amazon, it was dirt-cheap, arrived in like a day :)
<Degi> Hm yes, then maybe the 2232h is the best choice. So it doesn't need any configuration apart from OpenOCD for the MPSSE?
bvernoux has joined #nmigen
<agg> table 4.11 (in section 4.13.1) of the datasheet is "do i need an eeprom?"
<agg> for mpsse, looks like no, though an eeprom would let you customise the VID/PID and product strings
<agg> for the sake of a small cheap eeprom i'd probably fit it anyway
<agg> assuming that's what you mean by "any configuration" - the chip doesn't have any non-volatile memory built-in, so you often connect the eeprom to allow permanent configuration
<agg> (mpsse is what you need for jtag)
<hell__> the H variants can also be used as a SPI programmer with flashrom :-)
<Degi> Oh neat, so when I connect some pins to the SPI flash it can program it too?
<agg> yea, the 2232 has two interfaces, and each can be jtag or spi or uart or parallel FIFO to an fpga
<agg> if you don't include an eeprom they both default to uart and can be reconfigured to spi or jtag at runtime
<agg> eeprom also lets you store a serial number usb string which is handy for programming the right board if you ever have two ftdi chips plugged in at once, heh
<agg> what fpga are you using? some like ecp5 can pass-through spi flash to jtag, so you only need jtag connected
<Degi> Yes I want to use the ECP5 but AFAIK OpenOCD doesn't support that (yet)
<agg> huh, i would have thought it did
<agg> i don't use openocd so not sure
<Degi> At least somebody told me it didn't
<agg> openocd did just get a new release after like 3 years, for the longest time you had to build from source to get anything at all recent
<Degi> oh
<agg> anyway doesn't matter, if you're using ecp5 you can forego openocd and save yourself a load of pain
<agg> with ftdi, you can use https://github.com/gregdavill/ecpprog
<agg> which handles both loading bitstreams directly, and writing them to spi flash through the ecp5
<Degi> Oh that is very practical
<agg> or if you don't especially like ftdi (like me) i wrote https://github.com/adamgreig/ecpdap which can use any cmsis-dap debug probe to do the same thing (direct load or spi flash)
<agg> but if you just want a chip to solder to your pcb without much fuss, probably the ft2232h is an easier choice
<agg> sorry for dumping a ton of text, i remember it being a bit overwhelming when i was first looking into "how so how do i load bitstreams..."
<Degi> Yes I was too, maybe this should be documented somewhere well
<Degi> Thanks though!
<agg> i definitely recommend ecpprog instead of openocd for a plain ft232h->ecp5->spi flash setup, though, much simpler and easier
<Degi> So ecpdap can program the FPGA itself and program the flash separately? That sounds fine, maybe I'll just get a CMSIS-DAP probe, at least thats much cheaper than putting a FT2232H on every PCB
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
<agg> that's my strategy, i use the ARM 10-pin 0.05" debug connector that's common for SWD/JTAG, and then all my probes plug right in
<Degi> Nvm the FT2232H isnt available anywhere anyways
<agg> if you're making a development board it's sometimes nice to have the programming built-in, and sometimes you need a usb-uart or usb-fifo built in too, so it ends up being convenient to use the ftdi chip
<agg> lol of course
<Degi> Eh, I'll just use external UART, I guess worst case you can attach one to PMOD
<agg> wow yea looks like they're sold out across the board
<hell__> I'd try looking for `FT2232HL`
<Degi> Nope
<hell__> I have two FT2232HL modules from CJMCU: https://i.imgur.com/OIQE8om.jpg
pftbest has quit [Read error: Connection reset by peer]
pftbest has joined #nmigen
thorns514 has joined #nmigen
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
thorns514 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bertl_zZ is now known as Bertl
thorns514 has joined #nmigen
lf has quit [*.net *.split]
_whitenotifier-3 has quit [*.net *.split]
Yatekii has quit [*.net *.split]
lf has joined #nmigen
_whitenotifier-3 has joined #nmigen
Yatekii has joined #nmigen
ronyrus_ has joined #nmigen
bob_twinkles_ has joined #nmigen
lkcl has quit [*.net *.split]
ronyrus has quit [*.net *.split]
bob_twinkles has quit [*.net *.split]
lkcl has joined #nmigen
FFY00_ has quit [Remote host closed the connection]
lkcl has quit [Ping timeout: 268 seconds]
lkcl has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
<FL4SHK> so I've figured out what my DSL is going to generate: extended VHDL
<FL4SHK> well, extended only on my end
<FL4SHK> the code you write will generate the extended VHDL AST rather than just a VHDL AST
<FL4SHK> and I'll have to lower the DSL's AST into a VHDL One
<FL4SHK> ideas I've got are just convenience types
<FL4SHK> composite types
<FL4SHK> and, with this project, I'll be able to have VHDL variables!
<hell__> random idea: why not call this extended VHDL language EHDL?
<FL4SHK> that is a cool idea
<FL4SHK> but I've already named it
<FL4SHK> pyhdlgen
<hell__> ah
<FL4SHK> not too late to name it given that I have no users
<FL4SHK> rename
davidlattimore has quit [Read error: Connection reset by peer]
_florent_ has quit [Read error: Connection reset by peer]
sorear has quit [Read error: Connection reset by peer]
ianloic_ has quit [Ping timeout: 260 seconds]
roamingr1 has quit [Ping timeout: 265 seconds]
<FL4SHK> The reason I called it "pyhdlgen" instead of "pyvhdlgen" is in case I decide to have a way to generate SV or something
<FL4SHK> I'm starting with VHDL 2008
<hell__> hm
sorear has joined #nmigen
davidlattimore has joined #nmigen
ianloic_ has joined #nmigen
_florent_ has joined #nmigen
thorns514 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chipmuenk has quit [Quit: chipmuenk]
thorns514 has joined #nmigen
jeanthom has joined #nmigen
roamingr1 has joined #nmigen
bvernoux has quit [Quit: Leaving]
jeanthom has quit [Ping timeout: 246 seconds]
cr1901_modern has quit [Quit: Leaving.]
roamingr1 has quit [Ping timeout: 252 seconds]
FFY00_ has joined #nmigen
lkcl has quit [Ping timeout: 252 seconds]
GenTooMan has quit [Quit: Leaving]
cr1901_modern has joined #nmigen
GenTooMan has joined #nmigen
lf has quit [Ping timeout: 245 seconds]
lf has joined #nmigen
lkcl has joined #nmigen