Wednesday, 2020-12-02

*** tpb has joined #yosys00:00
*** smkz has joined #yosys00:01
*** srk has quit IRC00:07
*** srk has joined #yosys00:21
*** lf has quit IRC00:40
*** lf has joined #yosys00:40
*** podrian has joined #yosys01:04
podrianHello!  Relatively new to Verilog...  I have a design which makes use of `generate` blocks (they are named), and Yosys's write_verilog() is elaborating with names along the lines of `mod_type \genblk[0] (ports)`,  I suspect the backslash is escaping the brackets, but it appears that neither iverilog nor verilator know how to handle a module with01:09
podrianbrackets in its name (i'm driving everything with cocotb, so I guess it could be a cocotb thing).01:09
podrianIs there a way to modify the way the generate block module names are instantiated to something like `genblk_0_` rather than `\genblk[0]`  ???01:10
*** podrian has left #yosys01:11
*** podrian has joined #yosys01:11
*** podrian has left #yosys01:12
*** podrian90 has joined #yosys01:21
*** podrian90 is now known as podrian01:23
*** podrian has quit IRC01:26
*** podrian has joined #yosys01:28
podrianI guess it's actually something more like `\genblk[0].module(ports)` but I think it should be clear anyway :)01:29
*** fakedad has joined #yosys01:35
*** podrian has quit IRC01:36
*** Degi_ has joined #yosys01:38
*** Degi has quit IRC01:41
*** Degi_ is now known as Degi01:41
*** srk has quit IRC02:29
*** srk has joined #yosys02:42
*** citypw has joined #yosys03:31
*** srk has quit IRC04:02
*** srk has joined #yosys04:03
*** az0re has quit IRC05:15
*** az0re has joined #yosys05:18
*** vidbina has joined #yosys06:30
*** emeb_mac has quit IRC06:34
*** awordnot has quit IRC06:36
*** awordnot has joined #yosys06:41
*** m4ssi has joined #yosys07:37
*** vidbina has quit IRC08:36
*** kristianpaul has quit IRC08:50
*** kristianpaul has joined #yosys08:51
*** xtro has quit IRC08:54
*** kristianpaul has quit IRC09:04
*** kristianpaul has joined #yosys09:06
*** jakobwenzel has joined #yosys09:39
*** peepsalot has quit IRC10:04
*** peepsalot has joined #yosys10:06
*** aep has joined #yosys10:25
aephow would i figure out how pins are named in nextpnr? is there a human readable list?10:27
daveshahwhat do you mean? what pins?10:29
aepthe pin names you assign in pins.cnf .10:31
daveshahcnf?10:32
daveshahI'm afraid I need a bit more context, I'm not even sure what a cnf file is10:32
aeperr pcf, sorry10:33
aepi'm trying to port some hello world to a 40up5k board, but none of the pins exist10:33
aepnextpnr-ice40 --up5k --package sg48 --freq 20 --json top.json --pcf pins.pcf --asc top.asc    ==> ERROR: package does not have a pin named '8A' (on line 1)10:33
daveshahthe pins are the package pin numbers, not the board pin numbers10:34
aepright, where would i find them to guess what they're named?10:35
aepi tried pretty much all the name formats in the datasheet10:35
daveshahit's the physical, QFN48, pin number10:36
aepthis is probably obvious to someone who has used the propriatary tools, but i never did10:36
aepoooh. weird. the example used bank names10:37
aepand that worked fine10:37
daveshahcan you point me to the example?10:37
aephttps://github.com/lawrie/tiny_usb_examples/tree/master/hello_world10:37
daveshahthose are pin numbers too - but for a BGA package10:38
aepaha!10:38
Sarayanaep: https://www.latticesemi.com/view_document?document_id=51971 ?10:38
Sarayanfrom https://www.latticesemi.com/en/Products/FPGAandCPLD/iCE40UltraPlus#_1583858FEF1D4406B570F0CACD48526810:39
tpbTitle: iCE40 UltraPlus - Lattice Semiconductor (at www.latticesemi.com)10:39
Sarayanice40up5k pinout being that document10:39
aepoh nice10:39
SarayanI have a feeling that's what you need10:39
aepyes, thank you!10:40
Sarayan:-)10:40
*** vidbina has joined #yosys11:09
*** strobokopp has joined #yosys11:19
aepallright, next problem is i have never used lattice diamond, so im not familiar with the specific macros. like, i dunno what SB_PLL40_CORE is but nextpnr tells me to use a PAD PLL instead for which i also dont know the macro11:32
aepis there a document i could read that contains this stuff without going through the whole propriatary thing?11:33
aeplattice docs just say i should look in the ominous "iCE Technology Library" which is probably inside diamond?11:34
daveshahaep: http://www.latticesemi.com/~/media/LatticeSemi/Documents/TechnicalBriefs/SBTICETechnologyLibrary201608.pdfhttp://www.latticesemi.com/~/media/LatticeSemi/Documents/TechnicalBriefs/SBTICETechnologyLibrary201608.pdf11:36
tpbTitle: Server Error (at www.latticesemi.com)11:36
daveshah* http://www.latticesemi.com/~/media/LatticeSemi/Documents/TechnicalBriefs/SBTICETechnologyLibrary201608.pdf11:36
aepyeah just found the pdf and it contains exactly what i need to know. sorry for the noise D:11:36
*** jakobwenzel has quit IRC12:42
*** elGamal has quit IRC12:53
*** kristianpaul has quit IRC13:16
*** kristianpaul has joined #yosys13:19
*** vidbina_ has joined #yosys13:25
*** vidbina has quit IRC13:28
dkozeldaveshah: Were you working with an Alveo 250?13:47
daveshahI was, although I haven't had time for that recently13:47
dkozelOk, it's looking like we might be able to host one with a Xilinx license on a public server if that would be helpful to anyone13:48
dkozelAnything that we can do to help improve FOSS support, I'd be interested in hearing.13:49
daveshahI can't really think of anything that's going to be particularly practical there, tbh13:53
daveshahworking on IP is probably going to be more useful right now13:53
dkozelFor signals DSP, that's happening. What IP are you thinking of?13:54
fakedadHi, do either of you have any tips regarding how to change the naming of `generate` block arrays?13:56
*** fakedad has left #yosys14:54
*** maartenBE has quit IRC16:04
*** maartenBE has joined #yosys16:07
aephm, im failing at doing the PLL correctly. documentation says "It is strongly recommended that the configuration of the PLL primitives be accomplished through the use of the PLL Configuration tool that is offered as part of the iCEcube2 software."16:16
aepis there an open source alternative?16:16
*** emeb has joined #yosys16:17
*** jakobwenzel has joined #yosys16:17
daveshahyes, icepll16:17
aepoh nice, thanks16:19
aephah that actually worked out of the box. this stuff is NICE16:30
*** citypw has quit IRC16:51
*** xtro has joined #yosys17:07
aepoof the critical path errors are really hard to read. can i somehow make out where i'm spending too much time from the long list of error messages? https://gist.githubusercontent.com/aep/a042c92fb6e68653acc7ea6ce4efd15f/raw/9a200e97dff91916b8180639d7c021a236870d74/gistfile1.txt17:14
aepi mean, its clear which clock fails, but not where.17:14
daveshahit looks like you have a path via uart.usb_fs_pe_inst.usb_fs_out_pe_inst.ep_put_addr[0]; uart.usb_fs_pe_inst.usb_fs_out_pe_inst.ep_get_addr[0]; uart.ctrl_ep_inst.detect_pkt_end; uart.usb_uart_bridge_ep_inst.get_out_data etc17:16
aepthats not actually my stuff, and it works fine when i remove all of my code17:17
daveshahthe critical path looks to be entirely within the usb core17:17
aepyeah that's what confuses me17:18
daveshahit's possible that your code is making things more congested so putting more pressure on stuff overall, or it's just random17:18
aepam i reading the error message correctly that the whole design is clocking at 18Mhz?17:18
aepERROR: Max frequency for clock 'clk_48mhz_$glb_clk': 18.00 MHz (FAIL at 20.00 MHz)17:18
daveshahYes17:19
aepthats extremly slow for a 48Mhz clock D:17:19
daveshahif you look at the bottom, you can see only a very small proportion of paths are failing (negative in the histogram)17:19
aepi probably did some noob mistake that made a bad layout or something17:19
daveshahyou can't do all that much in 48MHz on an iCE40UP5K, tbf17:20
*** m4ssi has quit IRC17:20
aepi dunno, i guess i could just yolo in a higher clock, but i'm trying to learn here17:20
aepactually, i can't? a higher clock doesnt fix it. does that mean it's something not on the clock path?17:34
*** vidbina_ has quit IRC17:36
daveshahA _lower_ clock (below ~18MHz in this case) 'fixes' a timing failure17:42
daveshahNot a higher one17:42
*** cr1901_modern has quit IRC17:47
*** jakobwenzel has quit IRC17:49
*** elGamal has joined #yosys17:49
*** cr1901_modern has joined #yosys18:00
aeperrr, i think i dont understand what clocks this is reffering to. there's a pll and there's the thing you pass to --freq18:02
aepi _think_ the --freq argument is actually what its checking against, and obviously lowering that will make it pass, but that's kinda bad because i need to hit some timings for usb18:03
aepnut nothing i do with the pll seems to have any influence on the histogram18:03
daveshahyeah nextpnr-ice40 doesn't derive PLL timing constraints yet (mainly because with some of the stranger modes it's surprisingly hard to get right)18:15
daveshahto your PCF file, add `set_frequency clk_48mhz 48`18:15
aepah nice! now the output makes more sense. still failing to understand why my code wont pass tho18:17
daveshahis this usb core designed for the up5k?18:18
daveshahthe critical path makes me think it probably isn't; it looks a long way away from reaching 48MHz18:18
aepno.didnt find any. this is for the lp8k18:18
aepisnt the LP slower than the UP?18:19
daveshahthen tbh it probably isn't going to have a short enough critical path to pass timing on the up5k18:19
daveshahno, the UP is significantly slower18:19
aepooooh18:20
aepfunny. i bought into the marketing of "low power" versus "ultra"18:20
daveshahI know tnt's core works on the up5k - https://github.com/no2fpga/no2usb18:20
daveshahthe up5k is significantly lower power too, fwiw, and a good few years newer18:21
aepoh nice thanks18:21
aepi mean, the thing i use runs fine but thats probably because USB is veeery tolerant18:22
aepoh wait, is it failing because i have too much stuff on fast lines?18:24
aepwould explain why my trivial additional code makes it unhappy]18:25
daveshahNo, the critical path is definitely in the USB core18:25
daveshahbut moving stuff out of the 48MHz domain that doesn't need to be in it might help in general18:25
aepgood idea. lemme just reduce stuff on that clock18:27
*** elGamal has quit IRC18:27
aepactually, i wonder why the --gui thing is just grey for me. there's nothing colored in the device view18:27
*** elGamal has joined #yosys18:27
aepi was hoping i could use it to see if i made a dumb mistake that leads to bad routing18:28
cr1901_modernI wonder if tnt's core fits into an ice401k... and if not, how much could be removed to hack usb into that size18:28
cr1901_modernhx1k*18:28
aepdidnt get the other core working. still confused about the frequencies. is `set_frequency clk_48mhz 48` the constraint or the actual pll speed?19:10
aepbecause it keeps saying it failed 48mhz, which is uh.. yeah i know19:10
daveshahIts the constraint19:11
aephow does it know the real frequency then?19:22
cr1901_moderncritical path determines the real frequency19:23
aepoooh, the error is trying to tell me the frequency i set won't work because the critical path is slower?19:24
aepit says 3ns tho, thats perfectly fine for 48Mhz19:24
aepInfo: Max delay <async>                    -> posedge clk_48mhz_$glb_clk: 4.19 ns19:25
aepthat means the delay to propagate  the whole clock edge is 4.19 ns right?19:25
* cr1901_modern is unfortunately afk for a bit :(19:26
lambdaaep: I think the limiting stat here is (posedge -> posedge) on the clock, for which the critical path sits at 55ns, i.e. 18MHz20:03
aephmm but where do you see that?20:06
daveshahit's at the top of the long report20:06
*** kristianpaul has quit IRC20:06
daveshah'Info: Critical path report for clock 'clk_48mhz_$glb_clk' (posedge -> posedge):'20:06
daveshahat the bottom is 'Info: 22.5 ns logic, 33.0 ns routing'20:06
aepoooh20:07
daveshahin this case you've blown out your 48MHz budget just on logic, with nothing at all left for routing (which is often more delay than logic particularly for larger designs)20:07
aepyeah i think i can live with 20Mhz20:08
daveshahthe USB core is probably designed to run at 48MHz only20:08
aepthis is helpful now that i understand. bit confusing output20:08
aepuuh yeah but how would it ever run at 48Mhz if the PLL is 48 and it does a bunch of stuff on clock20:08
daveshahFPGA clocks are fixed by the PLL frequency - if the PLL is set to 48MHz then it is running at 48MHz20:09
daveshahif it fails timing, then it might not work reliably - FPGA timing models are very conservative at room temperature, but you might start seeing failures if it warms up20:09
cr1901_modernJust run it and increase the frequency until it stops working. Then dial the frequency back by 20% :) (don't actually do this)20:10
aepyeah, i was just wondering what you mean by 'designed to run at 48MHz only'.20:11
aepthe original makefile specified --freq 20 ... so it never validated at 48?20:12
daveshahthe core is designed to run at 48MHz because it oversamples the 12MHz USB rate by x420:12
aepah yes20:12
daveshahno, they were probably just relying on the fact that it failed timing but still worked even on the lp20:12
*** kristianpaul has joined #yosys20:12
aepthats how i got confused. it was never valid lol20:13
daveshahunless their PLL was actually set up to run at 20MHz, but that's a very unlikely frequency for a USB FS core which invariably pick integer multiples of 12MHz20:13
aepnope. was at 4820:13
aepwhich makes sense20:13
aepi guess i just need to find a different fpga that can actually do this20:14
daveshahtbf, it probably would have got a lot closer to 48 on a lp and been a lot less marginal20:14
aepright20:14
daveshahit's definitely possible to do USB on a up5k20:14
aephow would i know btw? experience or can you actually know this from the spec?20:14
daveshahthe trick is to do the fast part in the 48MHz domain and the rest in a 12MHz or 24MHz domain20:14
daveshahI know because people have done it (e.g. fomu, icebreaker-bitsy)20:14
aepuuh by domain you mean a different clock? this thing only has one20:15
aepoh right, i should look at fomu20:15
daveshahthere are various ways of getting multiple clocks from the PLL20:15
daveshahyou can either output clock and clock/2; or clock and input clock mirrored20:15
aepoh nice. SB_PLL40_2F_CORE i guess20:17
daveshahthis is how tnt's usb code does it20:17
daveshahhttps://github.com/no2fpga/no2bootloader/blob/master/gateware/ice40/rtl/sysmgr.v#L31-L6720:17
aepyeah i couldnt get that thing to be stable20:17
aepthe output looks like noise20:18
daveshahwhat board are you using?20:18
cr1901_moderndaveshah: Uhh, without thinking about it too much, why does "input clock mirrored" work to improve timing closure?20:18
aepthe ice40 b evb (the black one)20:18
daveshahcr1901_modern:  it's to do with the routing limitations of the iCE40 (can't use a dedicated PLL pin as a general input), not timing20:19
daveshahaep: should be fine, it's only the early upduinos that have broken PLL circuitry20:19
cr1901_modernhmmm20:19
aepyeah the weird core i found works perfectly despite failing timings20:20
aepi'll try no2fpga again. maybe i just didnt use it correctly (since there are no docs)20:20
daveshahI know from past experiences of people trying to get the old tinyfpga bootloader working on the up5k (which was fine on a lp8k but also failed timing badly on the up5k) it worked on some boards but not others20:20
daveshahbecause of process variations between the chips, slight vcc differences between regulators, etc20:21
aepyeah, i dont think i want to ship this with failing timings :D20:21
aepbtw, since i'm asking a lot of dumb questions. does anyone know any learning material that specifically uses yosys?20:22
daveshahhttps://github.com/icebreaker-fpga/icebreaker-workshop is a good start for the very basics20:23
aepi'd totally pay for a course. but the ones i had usually just do a bunch of clicks in some gui and never explain anything20:23
aepoh neat20:23
daveshahas far as the more intricate side of timing analysis specific to nextpnr goes, I don't think there is a particularly good reference to that - but that is definitely something that can be improved20:31
daveshahthe timing code in nextpnr is long overdue a substantial rewrite for better performance and functionality, so if you have any suggestions to presentation improvements, that would always be appreciated (and at some point I will do derived PLL constraints for ice40 which will make using them less confusing)20:32
aepoh yeah, it would very much helped if the "timing failed because this net takes 20ns" would be more obvious20:33
daveshahThe problem is that for something like this, the failure is for a whole path rather than a single net20:35
aephm yeah. i still have no idea where the problem is.20:37
*** kristianpaul has quit IRC20:53
*** kristianpaul has joined #yosys20:54
*** emeb_mac has joined #yosys21:14
*** indy has quit IRC22:29
*** indy has joined #yosys22:49
*** emeb has quit IRC23:34
*** pepijndevos_ has quit IRC23:40
*** pepijndevos has joined #yosys23:41

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!