Friday, 2019-12-27

*** tpb has joined #yosys00:00
*** rohitksingh has joined #yosys00:20
*** rohitksingh has quit IRC00:54
*** rohitksingh has joined #yosys01:00
*** shorne has joined #yosys01:08
*** Stary has quit IRC01:11
*** Stary has joined #yosys01:19
*** emeb has quit IRC01:50
*** kraiskil has joined #yosys03:20
*** lukego has joined #yosys04:06
*** dh73 has joined #yosys04:36
*** rohitksingh has quit IRC04:41
*** dh73 has quit IRC05:35
*** rohitksingh has joined #yosys06:05
*** emeb_mac has quit IRC06:32
*** vidbina has joined #yosys08:03
*** vidbina has quit IRC08:20
*** vidbina has joined #yosys08:21
*** kraiskil has quit IRC08:21
*** vidbina has quit IRC08:21
*** vidbina has joined #yosys08:22
*** vidbina has quit IRC08:40
*** vidbina has joined #yosys08:40
*** _whitelogger has quit IRC08:49
*** _whitelogger has joined #yosys08:51
*** vidbina has quit IRC09:00
*** vidbina has joined #yosys09:01
*** fsasm has joined #yosys09:02
*** _whitelogger has quit IRC09:10
*** _whitelogger has joined #yosys09:12
*** _whitelogger has quit IRC09:16
*** _whitelogger has joined #yosys09:18
*** vidbina has quit IRC09:37
*** promach3 has quit IRC11:33
*** fevv8[m] has quit IRC11:33
*** pepijndevos[m] has quit IRC11:33
*** nrossi has quit IRC11:33
*** _whitelogger has quit IRC11:49
*** _whitelogger has joined #yosys11:51
*** vidbina has joined #yosys12:23
*** dys has joined #yosys12:23
*** rohitksingh has quit IRC12:32
*** pepijndevos[m] has joined #yosys12:50
*** nrossi has joined #yosys12:50
*** fevv8[m] has joined #yosys12:50
*** promach3 has joined #yosys12:50
*** vidbina has quit IRC12:54
*** vidbina has joined #yosys12:56
*** vidbina has quit IRC13:12
*** vidbina has joined #yosys13:12
*** vidbina has quit IRC13:17
*** vidbina has joined #yosys13:18
*** kraiskil has joined #yosys13:32
*** vidbina has quit IRC13:40
*** vidbina has joined #yosys13:41
*** X-Scale has quit IRC13:50
*** vidbina has quit IRC14:04
*** vidbina has joined #yosys14:06
*** vidbina has quit IRC14:20
*** kraiskil has quit IRC14:26
*** kraiskil has joined #yosys14:27
*** kraiskil has quit IRC14:34
*** _whitelogger has quit IRC14:40
*** _whitelogger has joined #yosys14:42
*** fsasm has quit IRC14:59
*** rombik_su has joined #yosys15:46
*** klotz has joined #yosys15:47
*** vidbina has joined #yosys16:05
*** Jybz has joined #yosys16:17
*** emeb has joined #yosys16:24
*** vidbina has quit IRC16:40
*** kraiskil has joined #yosys16:41
*** kraiskil has quit IRC16:57
*** dh73 has joined #yosys17:03
*** meawoppl has joined #yosys17:51
meawopplhey all!17:51
meawopplcan anyone in the channel help me with how DDR signals should be treated in ice40 packages?17:52
ZipCPUSure17:54
ZipCPUWhat's up?17:54
ZipCPUTypically, I handle DDR signals by directliy instantiating an SB_IO primitive17:54
meawopplthat is already a helpful lead17:55
whitequarkthere's no other way to do this on iCE40 other than instantiating SB_IO17:55
meawoppllooking at that (macro?) is looks like you then get two output signals?17:56
daveshahNo, those will be the outputs from the DDR input17:56
daveshahThe output of the DDR output block is "PACKAGE_PIN"17:56
daveshahthat must be driving a top level output (or inout)17:56
meawopploh, I think I am getting the language backward here17:57
daveshahYou mean a DDR input primitive (i.e. the external pin is an input) ?17:57
daveshahor perhaps better said input DDR primitive17:57
meawopplpackage pin (or two b/c of differential input here) -> SB_IO -> 2 inputs17:58
meawopplI am implementing a MIPI receiver17:58
daveshahYeah17:58
daveshahso you want to use D_IN_0 and D_IN_1 on the SB_IO to drive your logic17:59
daveshahthe former is registered on the positive edge and the latter on the negative edge, iirc17:59
meawopplah, so those are set on the edges, then I can just look at 1 edge of the signal in my logic reading those?18:00
daveshahYes, all your logic following would be on the posedge18:02
meawopplposedge of the clock used to sync SB_IO18:02
daveshahyes18:02
meawoppland I expect a delay of 2 cycles then?18:02
daveshahoften you would have a posedge register as the next thing after the SB_IO at least on D_IN_118:02
daveshahyeah18:02
meawopplawesome, that makes so much more sense now18:03
meawopplI tried some really hacky stuffs making an xor'ed signal based on posedge+negedge logic18:03
meawoppland, the more I think about it, the more I am suprised it worked at all18:04
daveshahYeah that's nasty18:04
ZipCPUmeawoppl: Yeah, most FPGAs don't support that kind of logic.  It's in the language, I think, because certain ASIC logic needs to do that kind of stuff18:04
ZipCPU(Not certain, though, since ... I've never done ASIC work)18:05
meawopplit just seems really fraught to me now, thinking about the flip-flow state progression and I think the data would be underdetermined if the input clock was anything less than perfect18:05
ZipCPUmeawoppl: Incidentally, some of the ugliest "yosys" bugs have been linked to not using the SB_IOs.18:07
ZipCPUThe result is typically that yosys + (then) arachne-pnr would place the logic *anywhere* within the chip, leading to horrible I/O timings18:07
meawopplinteresting18:08
ZipCPUA Yosys update might adjust where the placement was made, since it was never controlled, and the design might go from working to not working.  The student or other user then blames the "yosys" change for why the design no longer works18:08
meawopplso SB_IO is basically 1:1 with some chip-edge special hardware?18:08
ZipCPUAbsolutely!~18:08
meawoppl(new to this all)18:09
ZipCPUIf you want timing to be controlled across multiple pins, you'll also want to make certain that the SB_IO uses the clock and registers all outputs as well.18:09
ZipCPUFor a single pin it usually doesn't make a difference, but across several pins in some I/O interface or another--perhaps one is a clock, another data, then ... yeah, you want to use the SB_IO primitives18:10
meawopplZipCPU thanks18:14
meawopplso here I am doing a differential clock and differential signal18:14
ZipCPUAre you creating the clock signal?18:15
meawopplso I use 1 SB_IO for the clock, then a second using that input clock to clock the DDR data input18:15
meawoppl(two sub-lvds pairs)18:16
ZipCPUI mean ... Are you generating the clock signal and outputting it from your design, or is it coming into your design as an input?18:16
meawopplthats coming in18:16
ZipCPUAre you using any global buffers?  SB_GB() ?18:17
meawopplI am for the clock (totally cargo-culted), I am honestly not sure what it buys me18:18
whitequarkfun fact: some Altera FPGAs actually use regular flip-flops to implement DDR I/O. they do constrain placement to be right next to the I/O tile though18:18
whitequarkregular fabric flip-flops, I mean18:19
ZipCPUwhitequark: Wow ... is that how those design elements worked?18:19
meawopplit looks like `SG_GB` does signal fanout to minimize latenccy?18:20
ZipCPUmeawoppl: It buys you low clock skew across the chip, making it more likely that everything within your design uses the same clock with the same skew18:20
ZipCPUYes, that's it18:20
whitequarkZipCPU: I'll tell you something worse. unless I misremember or misunderstood how it works, Altera actually implements *clock muxes* with LUTs on some FPGAs like Cyclone V18:20
ZipCPUThat said, I think there is a certain latency by going through the global buffer network, but it would be more controlled than just routing the pin without using the clock network18:21
whitequarkthat seemed very very strange to me, so I dug into it, and again, unless I really misunderstood something in their toolchain, it seems that's what they do.18:21
ZipCPUwhitequark: I'm not sure if I should be impressed and stand in awe, or if I should rather cringe at the sound of that18:21
whitequarkI suspect the latter. I have seen reports on the web that their trick of using FFs for DDR IO has rather unfavorable results.18:22
whitequarkwhich is exactly what you would expect.18:22
whitequarkremember that you need a LUT to mux the output from the posedge and negedge FF... so the timings of that complete construct are not great18:22
whitequarkbizarrely, the *input* DDR path on Cyclone V is actually hard logic in the IO tile. I'm wondering if they are working around a silicon bug or something.18:22
ZipCPUYeah, I suppose that would make sense18:23
ZipCPUMakes you wonder if it gets fixed in a future silicon revision --- or even if so .. how would you know and tell?18:24
whitequarkI think they've been dragging that design along for a rather long time, across many FPGA families18:24
meawopplinteresting, so when I plumb the clock signal (post `SB_IO`) should I route it directly into the data-SB_IO or should I use the post SB_GB signal?18:25
whitequarkZipCPU: take a look at this: https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/cyc/cyc_c51010.pdf18:27
ZipCPUmeawoppl: I'd use the SB_GB signal if possible18:27
meawopplgotcha, but it will introduce some latency into the read, right?18:28
ZipCPUwhitequark: "HTTP request sent, awaiting response... 403 Forbidden" ... well, maybe I'll look into it some other day18:28
meawopplbut consistent latency.... hermmm18:29
ZipCPUmeawoppl: Yes, but that's not saying much.  *Everything* will introduce some latency.  The question is whether or not that latency is significant in your application.  That I cannot answer.18:29
ZipCPUIf it is a problem, you might be able to adjust the phase of the clock ... but I wouldn't be able to cite information on that off the top of my head18:29
meawopplawesome, thanks for helping me understand all these tradeoffs18:31
whitequarknote that SB_IO+SB_GB is not the same as SB_GB_IO!18:34
whitequarkif you can, you really should use SB_GB_IO18:34
whitequarkas this can change the phase of your clock quite significantly. I hit that bug some time ago.18:34
ZipCPU??  whitequark: Can you explain the difference?18:35
whitequarkI think SB_IO+SB_GB actually routes your clock through fabric first18:35
whitequarkhttps://github.com/GlasgowEmbedded/Glasgow/issues/8918:35
tpbTitle: Use SB_GB_IO instead of SB_IO+SB_GB · Issue #89 · GlasgowEmbedded/glasgow · GitHub (at github.com)18:35
whitequarkI didn't check the actual netlist, but all signs point to SB_IO+SB_GB routing the clock through fabric, and not even always the same way18:36
* ZipCPU searches iCE40 doc's for SB_GB_IO information ...18:37
* ZipCPU finds references in the family handbook18:38
whitequarkunfortunately iCE40 does not have particularly great documentation18:42
meawopplinteresting, I can use that if I don't use the inputs, and just relay on the global buffer it produces...18:42
whitequarkfor example, have you seen the circuit diagram that describes the SB_IO behavior? it is profoundly wrong18:42
whitequark(quiz: where is it wrong?)18:43
whitequarkmeawoppl: yep, you should preferably do that18:43
rombik_suwhitequark: That's interesting! I'm looking rn at my DDR3 Cyclone V. At least in the floorplan Quartus shows that both DDIO_IN and DDIO_OUT contained within IOB (as dedicated h/w) and enabled. Judging from post-route netlist, looks like it's dedicated.18:48
rombik_su*at my DDR3 Cyclone V project.18:48
whitequarkhmmm18:49
whitequarkthen I might have misunderstood something18:49
rombik_suI will scramble simple project to inspect18:49
whitequarkcan you check for Cyclone III too/18:49
*** svenn7 has joined #yosys18:49
whitequarkI originally got a Cyclone III board by mistake and I might have first checked on it18:50
whitequarkand then misremembered18:50
rombik_suwhitequark: No problem, I'll check18:50
meawopplone other question for the group here18:51
meawopplwhat is the typical testing narrative/process for a `yosys` workflow18:51
meawopplright now I am using an oscilloscope for everything, but there are a bunch of modules I have written that seem very testable18:51
*** kraiskil has joined #yosys18:53
whitequarktypically people write Verilog testbenches and use Icarus Verilog18:53
meawoppl`testbench` was the keyword I needed there18:55
rombik_suwhitequark: From Cyclone III handbook: The DDR input registers are implemented with three internal logic element (LE) registers for every DQ pin. These LE registers are located in the logic array block (LAB) adjacent to the DDR input pin.18:55
rombik_suA dedicated write DDIO block is implemented in the DDR output and output enable paths. Figure 8–5 shows how Cyclone III device family dedicated write DDIO block is implemented in the I/O element (IOE) registers18:55
whitequarkaha, right, that's what I was missing.18:56
whitequarkZipCPU: ^18:56
whitequarklooks like Cyclone (original) implemented DDR input and output in fabric, Cyclone III moved output into IOB, and Cyclone V has input and output in IOB18:56
*** dys has quit IRC18:57
rombik_suI'm pretty sure C4 have dedicated DDR h/w in IOBs18:57
ZirconiumXrombik_su: Ah, a fellow Cyclone V user18:57
* rombik_su checking18:57
rombik_suZirconiumX: \o/18:58
ZirconiumXI've actually been working a bit on the Cyclone V stuff today18:58
ZirconiumXWe now have carry chain support :P18:59
ZirconiumXUnfortunately integrating into Quartus is hell on earth18:59
rombik_suwhitequark: I'm wrong, Cyclone IV has the same story as Cyclone III wrt to DDR in IOB18:59
ZipCPUmeawoppl: There's a "better" Yosys workflow that goes through a formal verification step before going into the simulator.  Spares you some simulation cycles19:02
meawopplis simulation really slow?19:05
rombik_sumeawoppl: It depends on the simulator (iverilog vs commercial) and design size/complexity19:06
ZipCPUDefinitely depends upon design size and complexity19:07
sorearformal verification (satisifiability) can also be very slow19:12
*** pie_ has joined #yosys19:13
ZipCPUsorear: It can be, but in 90% of my example cases, it takes less than 2 minutes19:13
ZipCPUSee for reference: https:zipcpu.com/formal/2019/08/03/proof-duration.html19:14
dh73It might be difficult to integrate into Quartus, because there are parameters still needed, and special inputs that you should be using. I can't remember if "shared_arith" is needed for carry chain, and also, sumout and cin inputs should be used for this instead of normal dataa..datag afaik19:18
ZirconiumXYes, that's what I'm using dh7319:19
ZirconiumXdata{a,b,c,d,f}19:19
ZirconiumXBut that's not my point here19:19
ZirconiumXQuartus breaks on valid Verilog if you try to pass it as VQM19:20
ZirconiumX(Syntax error last time I checked)19:20
ZirconiumXIf you pass it as Verilog, Quartus will instead ICE19:20
ZirconiumXAnd if you pass it as EDIF, Quartus complains that the ground net cannot be used more than once19:21
dh73Wait a second19:22
dh73What I said is, carry chain needs cin and datad as inputs, cout and sumout as outpus, not the normal dataa..datag, but anyway in any case Quartus clearbox will merge the logic in that fashion if you don't, is kind of a carry computation, just mentioning. I didn't know Quartus supports edif now, but I will not expect that thing working fine at all. Can I use one of your examples to see what errors the tools is giving?, just for curiosity19:26
ZirconiumXdh73: https://github.com/YosysHQ/yosys/pull/1554 has a `-edif` option19:27
tpbTitle: synth_intel_alm: replacement flow for ALM-based Intel FPGAs. by ZirconiumX · Pull Request #1554 · YosysHQ/yosys · GitHub (at github.com)19:28
dh73thanks!19:30
ZirconiumXI have timing tables for C10GX, but I don't want to overload the patch reviewers just yet :P19:31
ZirconiumXA10GX would need new tables I think because it uses a different process19:32
*** quigonjinn has joined #yosys19:34
rombik_suArria 10 is 20 nm, Cyclone V is 28 nm19:35
ZirconiumXC10 is also 20nm19:36
ZirconiumXAIUI19:36
rombik_suCyclone 10 GX is 20 nm, Cyclone 10 LP is *60* nm19:38
ZirconiumX...I'd noticed that the 10LP seemed to be slower than the IV19:40
quigonjinnI know arachne-pnr is not maintained, just a question in case someone here can answer. Running the tests of the latest commit fails with yosys-0.9 and 0.8, but is successful with 0.7. The relevant part is in the folowing paste: https://paste.debian.net/1122888/ It keeps allocating memory until the system run out of memory. Is this some bug with the latest versions of yosys, or just arachne-pnr is not compatible with19:41
quigonjinn them?19:41
tpbTitle: debian Pastezone (at paste.debian.net)19:41
ZirconiumX...If arachne-pnr is not maintained, isn't it a bit counterproductive to ask a question that involves arachne-pnr maintenance?19:41
whitequarkyou really just shouldn't use arachne-pnr19:48
whitequarkit has no value beyond being a proof of concept. the quality of routing is very poor19:48
whitequarkeven if I knew the answer, I'd just tell you to not use it.19:48
*** vidbina has joined #yosys20:11
quigonjinnjust wondering if this may be a yosys bug, becauses it occurs with yosys being run20:13
*** vidbina has quit IRC20:19
*** vidbina has joined #yosys20:20
*** X-Scale has joined #yosys20:23
*** Jybz has quit IRC20:28
*** vidbina has quit IRC20:35
*** vidbina has joined #yosys20:36
*** emeb_mac has joined #yosys20:45
*** fsasm has joined #yosys20:58
meawopplAnother question re: Global buffers and the ice40 package21:00
meawopplI am getting this error:21:00
meawoppl```21:00
meawoppl`ERROR: BEL 'X9/Y0/io0' has no global buffer connection available`21:00
meawoppland I am not sure what to make of it21:00
meawopplI think this is confusing because I am mixing global-buffer with LVDS here21:02
meawopplIf I use SB_GB_IO with lvds, does the + pin have to be one with the global buffer tap?21:04
*** vidbina has quit IRC21:06
*** vidbina has joined #yosys21:08
daveshahYes, it does21:16
meawoppldaveshah will it not let me use the COMP pin, or will it just be inverted?21:25
daveshahYou will get an error if you use the COMP pin21:25
meawopplmakes sense, I am going to see if I can getaway without using it, because this boxes me into an annoying position, I have to use bank3 (subLVDS), and the GB wiring is on the comp line :/21:29
*** emeb_mac has quit IRC21:33
daveshahWhich chip is this?21:34
meawopplthe sg48 package21:35
meawopplweird, I may have misread this21:45
meawopplwhat is `the sysIO buffer`?21:45
daveshahThis is a up5k21:45
daveshah?21:45
meawopplyessir21:45
daveshahthe sysIO buffer is just the IO buffer21:45
daveshahwhich pins are you trying to use21:45
daveshahI think at least one Lattice doc is wrong in terms of the up5k21:49
daveshahYou don't have to use bank 3 for LVDS, definitely, and afaik the positive side is A not B21:49
*** dh73 has quit IRC21:53
*** dh73 has joined #yosys21:53
meawopplthe page I was looking at was here: https://www.latticesemi.com/view_document?document_id=5197122:03
meawopplspecifically that `IOB_3b_G6` seems to be the negative differential pair22:06
daveshahYes, that looks to be a problem22:06
meawopplconfusingly numbered bank2 here22:06
daveshahThat is the correct document22:06
daveshahThe bank thing only applies to earlier iCE40 devices22:06
daveshahAll of the UP5K pairs can be used as differential inputs regardless of bank22:06
meawopplbah, so I was just looking at an old doc somewhere?22:11
meawopplheh, I resister swapped this bank down to subLVDS voltages, now I suspect I have to do the swap....again to get to a differential with global input22:12
meawopplbah22:12
meawopplI am going to see if I can get away with this configuration for a bit, I am only using the clock as DDR input to the SB_IO, and a demuxing layer, so might be ok22:35
*** fsasm has quit IRC22:53
*** rombik_su has quit IRC23:04
meawopplso, somewhat confusing question23:04
meawopplis partial bit-range assignment allowed in yosys23:04
meawoppllike23:04
meawopplreg[3:0] foo;23:05
meawopplalways @whatever23:05
meawoppl    reg[2] <= 1;23:05
meawoppl?23:05
daveshahYeah that should be fine23:05
ZirconiumXThat's standard verilog23:23
*** emeb has quit IRC23:33
*** emeb_mac has joined #yosys23:37

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!