clifford changed the topic of #yosys to: Yosys Open SYnthesis Suite: http://www.clifford.at/yosys/ -- Channel Logs: https://irclog.whitequark.org/yosys
lutsabound has quit [Quit: Connection closed for inactivity]
emeb has quit [Quit: Leaving.]
emeb_mac has joined #yosys
AlexDaniel has joined #yosys
gsi__ has joined #yosys
gsi_ has quit [Ping timeout: 245 seconds]
leviathanch has joined #yosys
lutsabound has joined #yosys
leviathanch has quit [Remote host closed the connection]
somlo has joined #yosys
<emeb_mac> up5k w/ USB for futzing w/ TinyFPGA USB bootloader sent to OSHpark
rohitksingh has joined #yosys
s_frit has quit []
citypw has joined #yosys
rohitksingh has quit [Ping timeout: 245 seconds]
rohitksingh_work has joined #yosys
rohitksingh has joined #yosys
rohitksingh_work has quit [Ping timeout: 250 seconds]
rohitksingh has quit [Ping timeout: 244 seconds]
rohitksingh has joined #yosys
<promach> corecode : so, I guess it is a better idea to stop the sby ?
<promach> still had not finished yet :(
lutsabound has quit [Quit: Connection closed for inactivity]
rohitksingh_work has joined #yosys
proteusguy has quit [Remote host closed the connection]
rohitksingh has quit [Ping timeout: 250 seconds]
rohitksingh has joined #yosys
proteusguy has joined #yosys
blunaxela has quit [Quit: leaving]
blunaxela has joined #yosys
pie__ has joined #yosys
pie___ has quit [Ping timeout: 250 seconds]
rohitksingh_work has quit [Read error: Connection reset by peer]
rohitksingh_work has joined #yosys
_whitelogger has joined #yosys
citypw has quit [Ping timeout: 244 seconds]
citypw has joined #yosys
emeb_mac has quit [Ping timeout: 244 seconds]
leviathanch has joined #yosys
m4ssi has joined #yosys
m4ssi has quit [Quit: Leaving]
m4ssi has joined #yosys
citypw has quit [Ping timeout: 250 seconds]
<MoeIcenowy> emeb_mac: for the TinyFPGA USB BL, is any IO suitable for USB or a differiental pair specified by the pinout table is needed?
<daveshah> Any IO works
<daveshah> you can't use a FPGA diff receiver on its own for USB <3.0 in any case, as it has some single ended signalling modes
<promach> can't use a FPGA diff receiver on its own for USB 2.0 ?
<promach> daveshah : why ?
<daveshah> promach: because USB has some single ended modes (where both pairs are at the same value)
<tnt> Can yosys infer dual clock RAM with different read/write width ?
<daveshah> tnt: yes, hopefully
<promach> I see
<daveshah> *both lines of the pair, not both pairs
<tnt> daveshah: I tried this, but ... https://pastebin.com/TvbRjLAA
<tpb> Title: module usb_ep_buf #( parameter TARGET = "ICE40", parameter integer RWI - Pastebin.com (at pastebin.com)
<promach> daveshah: but wait, what about tinyFPGA BX ?
<daveshah> promach: that is USB 1.1
<daveshah> and uses just two single ended pins
<promach> what about the upcoming EX version ?
<daveshah> USB 1.1 doesn't need any kind of diff receiver
<tnt> well technically you can have a 2.0 compliant device that does FS only ...
<daveshah> that supports 1.1 on IO pins or 3.0 on the transceivers but not 2.0
<promach> so, https://github.com/davidthings/tinyfpga_bx_usbserial is USB 1.1 , and not USB 2.0 ?
<tpb> Title: GitHub - davidthings/tinyfpga_bx_usbserial: USB Serial on the TinyFPGA BX (at github.com)
<tnt> promach: It's usb full-speed.
<promach> so, it is USB 2.0
<promach> tnt
<tnt> It's USB 2.0 compliant (well ... maybe, didn't check if they passed the compliance tests), but it doesn't use the 'High-Speed' mode that was introduced in USB 2.0.
<tnt> LS = Low Speed = 1.5Mbps FS = Full Speed = 12 MBps HS = High Speed = 480 MBps.
<tnt> you can do LS and FS using normal IO pins/CMOS drivers.
<tnt> for HS you need a dedicated PHY chip.
<promach> ok
<corecode> hi
<corecode> i wonder whether a HS USB SIE done using a softcore would be smaller and easier to maintain than a monolithic design
<promach> SIE ?
<corecode> serial interface engine
<MoeIcenowy> I heard that Lattice claims USB on Lattice FPGAs w/o ext PHY is not possible
<corecode> because they didn't certify it for usb
<tnt> corecode: what do you mean monolithic ?
<corecode> non-microprogrammed
<tnt> Oh. Well it's not HS (only FS), but ATM I'm doing a USB core that implements the 'usb stack' in a CPU. Much like you would find an common microcontroller. Packet level stuff is done in hardcoded logic. Transaction stuff is done in a microprogrammed state machine, and then the higher "transfer" layer is left to the CPU to do.
<corecode> the SIE
<corecode> are you doing a HS SIE?
<corecode> i don't know too much about HS frames
<tnt> no, FS only. I don't want an external PHY.
<corecode> okay
<corecode> is there much to do even?
<MoeIcenowy> I think USBASP is some USB LS implemented in software with 8-bit AVR...
<MoeIcenowy> it astonished me
<corecode> receive packet id, address, buffer out, checksum, ack?
<tnt> corecode: for HS you mean ?
<corecode> generally
<corecode> that needs to be in the fast loop
<corecode> i think you only have so many bit times to answer ack/nak
<tnt> The transaction layer needs to be fast, you only have 6.5 bit time to respond in FS.
<tnt> So when you get a IN or OUT token, you have to decide fast what to answer.
<corecode> right, so that needs to be in a register already
<MoeIcenowy> maybe implementing LS will be more loose?
<corecode> LS will be the same, just slower
<corecode> 1/10
<MoeIcenowy> USB is too strict!
<MoeIcenowy> (escape
<corecode> what
proteusguy has quit [Ping timeout: 246 seconds]
<tnt> corecode: yeah, I have basically just enough time to fetch from RAM the endpoint status and start the reply. That's why the transaction layer is still done in 'logic' (ok, microprogrammed, but still not quite a generic CPU) and not by just the soft core.
<corecode> ah you don't keep the EP in registers?
<tnt> No, I keep buffer rings in a RAM.
<tnt> And fetch/writeback when starting/finishing the transaction.
<corecode> ok
<tnt> I wanted to be able to handle many endpoints without too much overhead.
<corecode> yea i understand
<tnt> Although technically you can only have 16 endpoints :/
<corecode> technically?
<corecode> also, bidirectional
<corecode> plus multiple buffers
<tnt> The EP field is 4 bits
<corecode> yes
<tnt> Oh yeah, endp numbers can be re-used for IN/OUT.
leviathanch has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<tnt> daveshah: any idea where I could find a example for that dual clock / different width ? Pretty much everything I tried resulted in ... no RAM :p
<tnt> mm, actually from what I read, I don't see that yosys can infer READ_MODE != WRITE_MODE
rohitksingh_work has quit [Read error: Connection reset by peer]
<daveshah> no, although some quick tests and it's happy to fake it with logic and the mask input
<tpb> Title: Snippet | IRCCloud (at www.irccloud.com)
<MoeIcenowy> BTW is it possible to implement ADC with iCE40?
<daveshah> MoeIcenowy: yes, probably
<daveshah> either doing something like charge time measurement of a capacitor, or sigma-delta with a diff input as a comparator
<MoeIcenowy> I think some AN of Lattice mentioned it on ECP and XO series
<MoeIcenowy> it should apply to iCE
<tnt> google "Common Analog Functions Using an iCE40 FPGA", first result.
rohitksingh has quit [Ping timeout: 255 seconds]
<tnt> (couldn't ... ungooglify the link ...)
AlexDaniel has quit [Ping timeout: 244 seconds]
<tnt> Ah well, I managed :p
proteusguy has joined #yosys
rohitksingh has joined #yosys
<corecode> doesn't this take quite some space on the fpga?
<tnt> DAC ? not so much. ADC a bit more since you need the CIC but depends what kind of rate / precision you want.
rohitksingh has quit [Ping timeout: 250 seconds]
rohitksingh has joined #yosys
emeb has joined #yosys
promach2 has joined #yosys
<promach2> corecode : is it difficult to write a USB softcore from scratch ?
ZipCPU has quit [Quit: ZNC 1.6.4 - http://znc.in]
<corecode> i don't know
<corecode> i've only written the protocol part, not the bit part
<promach2> bit part ?
<promach2> corecode
<corecode> layer 0 and 1 stuff
citypw has joined #yosys
<promach2> corecode : you don't need to do the physical layer part
<promach2> why would you ?
<corecode> you don't need anything, you can buy everything completed
<promach2> no offense. I mean the physical layer involves IO analog circuitry, that requires tapeout
<promach2> corecode
<corecode> no
<corecode> usb LS and FS can be done with gpios
<promach2> and what exactly do you mean by "layer 0 and 1" ?
<daveshah> the tinyfpga does it with a grand total of three resistors, the rest being done with FPGA pins
<promach2> two series resistors and one pull-up
<promach2> what exactly is "layer 0 and 1" ?
<promach2> I have been reading the official USB 2.0 spec , but there is no mention of that so far
<promach2> corecode
<MoeIcenowy> daveshah: is the resistor value critical?
<tpb> Title: Extra resistor on FPGA transmitter pin · Issue #1 · avakar/usbcorev · GitHub (at github.com)
<daveshah> The 1.5k should be reasonably accurate, iirc, but I don't know about the 68r one
<corecode> promach2: sorry, i mean layer 1 and layer 2 (osi model)
<promach2> corecode : so, you are working on layer 2 (data link layer) now ?
<corecode> promach2: i.e. physical layer (electrical) and data link
<corecode> i am not working on anything
<promach2> so, you had done implementing chapter 8 of USB 2.0 spec
<promach2> now only left with chapter 5
<MoeIcenowy> I mean the 68r ;-)
<MoeIcenowy> the SMT service where I use (JLC SMT) doesn't offer 0402 68R
<corecode> promach2: what are you talking about
<corecode> which 68R
<corecode> jlc offers pcba?
<MoeIcenowy> corecode: not full PCBA
<MoeIcenowy> only the SMT of specified components
<promach2> corecode : chapter 8 is protocol layer , chapter 5 is data flow model
<MoeIcenowy> and only available in Chinese
<promach2> corecode : USB 2.0 spec
<MoeIcenowy> but with it I can use 0402 components...
<MoeIcenowy> I don't dare to solder them by myself...
<tpb> Title: USB in a NutShell - Chapter 1 - Introduction (at www.beyondlogic.org)
<corecode> i know usb
<promach2> MoeIcenowy : no worry, with few weeks of practice, you could do 0201 with only soldering gun under few seconds
<corecode> promach2: what are you working on?
<promach2> corecode : huh ?
<MoeIcenowy> promach2: I have no soldering gun
<MoeIcenowy> only soldering iron
<emeb> heh
<promach2> same thing
<corecode> promach2: what project are you working on?
<corecode> you seem to be doing usb, network on chip, etc.
<MoeIcenowy> oh I thought you meant heating gun
<promach2> no, you do not need hot-air gun
<corecode> hot air station is important
<corecode> and cheap
<promach2> soldering iron is way cheaper
<promach2> and precise
<corecode> good one not
<promach2> corecode : going to start on usb once I am done with NoC
Thorn has joined #yosys
<corecode> is this for work or a hobby?
<MoeIcenowy> I'm thinking whether I will be able to solder iCE40UP5K-SG48I with soldering iron
<daveshah> The exposed pad will be tricky, and can't be skipped because it's the only grounding
<MoeIcenowy> daveshah: I reserved a through hole for it
<emeb> that's what kevin hubbard does - great big hole in middle of the exposed pad
<emeb> fill in w/ solder from the back
<emeb> I just use paste + hot air to solder those QFNs
<corecode> MoeIcenowy: no, use hot air
<MoeIcenowy> I remember once I got a free unsoldered GD32F150G8U6 board from JLC
<MoeIcenowy> and finally I disposed it
<corecode> you don't need paste, but you need hot air
<MoeIcenowy> as I found I'm not able to solder the exposed pad of GD32F150G8U6
<MoeIcenowy> my table is too small to keep a hot air gun...
<corecode> ok
<corecode> i guess you can find some solder ninja just around the corner
<emeb> corecode: so all your u4k work got accepted into mainline?
<corecode> yes
<emeb> \o/
* emeb goes to pull & rebuild
<promach2> u4k ?
<emeb> older lattice ice40 ultra stuffs
<cr1901_modern> Ahhh someone was gonna offer me hardware to do ultra RE, but I got too busy. Nice work
<cr1901_modern> is ultralight still up for grabs?
<daveshah> cr1901_modern: yeah ultralite still available
<daveshah> happy to pay for hw too
<cr1901_modern> hmmm tempting. (for the record, someone _else_ was gonna offer me h/w, but they're on social media break atm)
<cr1901_modern> I've been trying to coordinate w/ Andres, but the times we are awake/active don't seem to coincide
<cr1901_modern> corecode: You did just the 4k family of ultra?
<daveshah> there is only the ultra 4k
<daveshah> the other parts are pseudo-devices
<daveshah> ditto there is only one ultralite
<cr1901_modern> ahhh, well ultralite is about machxo2-1200 level of complexity
<daveshah> yeah, although probably less fuzzer hacking needed as I think it is closer to the ice40up than the xo2 is to the ecp5
<cr1901_modern> let me touch base w/ andres.
<cr1901_modern> corecode: MachXO2 is probably going to reach a point of usability soon. Would be happy to help w/ ultralite if you want to do it (or start it myself when machxo2 reaches minimum viable product).
<emeb> daveshah: is u4k also in yosys & nextpnr?
<daveshah> yes
<emeb> nice
emeb_mac has joined #yosys
emeb_mac has quit [Client Quit]
<MoeIcenowy> is someone doing MXO2 RE?
<cr1901_modern> MoeIcenowy: Me, technically but it's stalled due to chronic "I can't multitask"-itis
lutsabound has joined #yosys
rohitksingh has quit [Ping timeout: 244 seconds]
rohitksingh has joined #yosys
keesj has joined #yosys
<corecode> if you're going to put in dozens of hours for reversing, $30 for an eval board is negligible
<MoeIcenowy> I think I have seen some LCMXO2-4000HC-4MG132 board for CNY ¥169
<MoeIcenowy> ~$25.15
AlexDaniel has joined #yosys
citypw has quit [Ping timeout: 259 seconds]
rohitksingh has quit [Ping timeout: 246 seconds]
<emeb> always fun when building yosys to get to the 95% point where ABC takes the other 95% of the time. :)
<shapr> I can build yosys so fast on my new laptop... now if I only had some clue about verilog
<shapr> even the most powerful hardware does not increase my skills all by itself
m4ssi has quit [Remote host closed the connection]
rohitksingh has joined #yosys
<emeb> lots to learn
<emeb> corecode: daveshah: trying to build a simple blinky for u4k. yosys seems to work but nextpnr gives Fatal error: file not found --u4k
<emeb> when i do --help for nextpnr it lists --u4k as a device option though. what am I doing wrong?
<daveshah> emeb: what is your full command line?
<emeb> nextpnr-ice40 --pcf-allow-unconstrained --pre-pack --u4k --json bob_blinky.json --pcf ../src/bob_blinky.pcf --asc bob_blinky.asc
<daveshah> --u4k shouldn't be after --pre-pack
<emeb> ok
<daveshah> --pre-pack file runs a Python file before packing
<daveshah> Usually for constraints
<daveshah> So it's interpreting --u4k as a file
<emeb> daveshah: ok - I see what's wrong. missing the constraint file define in my makefile. derp.
<emeb> daveshah: is there a place I can look which tells me what cells a particular target FPGA family supports?
<emeb> eg - what's the name of the RGB driver in u4k
<emeb> since it's not the same as in up5k
<emeb> and doesn't match up with what icecube2 uses.
<daveshah> No, I made that for ECP5 but nothing like that exists for ice40 other than vendor documentation
<daveshah> Ask corecode but I don't think the u4k rgb is supported in nextpnr yet
<emeb> kk
<emeb> corecode: do you implement the RGB driver in u4k?
<emeb> if so, what's it called?
lutsabound has quit [Quit: Connection closed for inactivity]
<tnt> Does anyone see anything wrong with that functions :
<tpb> Title: function [15:0] ram_wr_map2 (wire [1:0] wdata); ram_wr_map2 = { - Pastebin.com (at pastebin.com)
promach2 has quit [Ping timeout: 268 seconds]
<emeb> nothing obvious to me
<tnt> arf, you need 'input wire' and not just 'wire' ....
<ylamarre> ... VHDL has a nice "feature for this kind of assignement where you can assign parts of a signal then give a "default value" to others....
* ylamarre wonders if nMigen and/or MyHDL have this feature...
<tnt> ylamarre: oh yeah right. tbh I mostly used that to assign 0 to the whole verctor :p x <= (others => '0'); :p
<ylamarre> Yes, but you can also do weird slices that way too.
<ylamarre> Most missed feature when I had to transfer to verilog.
<tnt> Damnit, iverilog doesn't like my function either ... syntax error :/
<tnt> 'input wire' -> 'input'
gsi__ is now known as gsi_
<tnt> Mmm, yosys doesn't seem to like the 'new style' of having the reset at the end of the process when using a 'case' and an async reset : https://pastebin.com/NWwTrNmz
<tpb> Title: always @(posedge clk or posedge rst) begin case (d) - Pastebin.com (at pastebin.com)
<tnt> ERROR: Multiple edge sensitive events found for this signal!
<emeb> I remember Clifford advocating for the "reset at end" style. Interesting that yosys doesn't like it sometimes.
<ylamarre> Looks like it's more about the always block then the reset location...
<ylamarre> Coded this way it looks like you have two clocks.
<tpb> Title: module test( input wire d, output reg q, input wire clk, input wire rst - Pastebin.com (at pastebin.com)
<tnt> this is the other variant that works fine.
<ylamarre> Wow...
<daveshah> tnt: I don't think the first code is legal Verilog for synthesis
<tnt> daveshah: Ok, indeed, so it's not yosys specific. It's just that in verilog with async reset you don't have a choice you _must_ use the legacy style resets. Good to know.
<tnt> TIL :)
<daveshah> However, aiui, async reset blocks don't have the "not putting a signal in the reset block makes reset a clock enable instead of just ignoring reset" problem as with sync resets
<daveshah> so the only problem is inconsistency, the actual advantage of the reset at end style isn't present
<tnt> Yeah, I was going for consistency :) But I never do process that have mixed reset/non-reset signals anyway, so the 'end style' is really just a 'style' for me ... no actual benefit.
lutsabound has joined #yosys
<corecode> can you explain?
tpb has quit [Remote host closed the connection]
tpb has joined #yosys