Sunday, 2020-05-03

*** tpb has joined #yosys00:00
az0reHey, I'm not saying it's easy, just that it would be cool :)00:03
*** bwidawsk has quit IRC00:28
*** alexhw has quit IRC00:31
*** alexhw has joined #yosys00:36
*** emeb has quit IRC00:44
*** bwidawsk has joined #yosys00:44
*** emeb_mac has joined #yosys00:46
*** daknig has joined #yosys00:53
*** X-Scale` has joined #yosys01:11
*** X-Scale has quit IRC01:12
*** X-Scale` is now known as X-Scale01:12
*** citypw has joined #yosys01:16
*** citypw_ has joined #yosys01:28
*** citypw has quit IRC01:29
*** strobokopp has quit IRC01:56
*** Degi_ has joined #yosys03:50
*** Degi has quit IRC03:50
*** Degi_ is now known as Degi03:50
*** BinaryLust has quit IRC05:29
*** BinaryLust has joined #yosys06:26
*** _whitelogger has quit IRC06:39
*** _whitelogger has joined #yosys06:41
*** emeb_mac has quit IRC06:55
*** voxadam_ has quit IRC07:19
*** voxadam has joined #yosys07:23
*** vidbina has joined #yosys07:45
*** Asu has joined #yosys09:02
*** vidbina has quit IRC09:40
*** _whitelogger has quit IRC10:36
*** _whitelogger has joined #yosys10:38
*** voxadam has quit IRC11:44
*** Ristovski has quit IRC12:07
*** voxadam has joined #yosys12:09
*** [Ristovski] has joined #yosys12:10
*** vidbina has joined #yosys12:12
*** daknig has quit IRC12:17
*** Asu has quit IRC12:28
*** Asu has joined #yosys12:28
*** Asu has quit IRC12:32
*** [Ristovski] is now known as Ristovski12:40
*** Asu has joined #yosys12:41
*** daknig has joined #yosys13:11
*** daknig has quit IRC13:24
*** vidbina has quit IRC13:56
*** voxadam has quit IRC14:24
*** voxadam has joined #yosys14:33
*** daknig has joined #yosys14:34
*** adjtm has quit IRC14:39
*** adjtm has joined #yosys14:39
*** voxadam has quit IRC14:50
*** vidbina has joined #yosys14:54
*** craigo_ has quit IRC15:02
*** voxadam has joined #yosys15:10
*** BinaryLust has quit IRC15:33
*** emeb has joined #yosys15:42
*** citypw_ has quit IRC16:27
FL4SHKaz0re:  I use different syntax for Verilog constructs that end up exactly the same as in Verilog16:35
FL4SHKI don't plan on letting you use Verilog syntax directly16:37
whitequarkaz0re: re undecidability: the Verilog simulation semantics are nondeterministic by design, aren't they?16:37
FL4SHKbut I do plan on it being possible to use Verilog modules that are external to what's been written in my language16:38
FL4SHKoh, but the generated Verilog produced by my HDL won't include the parameterization16:39
FL4SHKThat stuff has to be flattened16:39
whitequarkFL4SHK: have you seen the connect_rpc Yosys command?16:39
FL4SHKI haven't16:39
FL4SHKWhat does that command do?16:39
whitequarklets you instantiate parametric modules in your HDL from any other HDL supported by Yosys16:41
whitequarke.g. you can take a parametric nMigen design and instantiate it from Verilog16:42
FL4SHKI see.16:42
FL4SHKI've peeked at nMigen before.16:42
FL4SHKIt seems nice.16:42
whitequarkthanks!16:44
whitequarkI've been trying to improve the state of HDL interop in Yosys while working on it, too.16:44
FL4SHKMy language is intended to be compiled into behavioral Verilog, btw16:45
FL4SHKbut I can probably just make that only one of the output modes16:45
FL4SHKand have... was it RTLIL?16:45
FL4SHKCould just support outputing that.16:45
FL4SHKRight now I'm just trying to get a minimum viable product built.16:46
FL4SHKcode is here:  https://github.com/fl4shk/fling_hdl16:47
tpbTitle: GitHub - fl4shk/fling_hdl: A Hardware Description Language with features similar to my custom programming language, Fling (at github.com)16:47
FL4SHKFling the programming language is on hold, haha16:47
whitequarkyeah, RTLIL16:50
whitequarkRTLIL is a lot easier to emit correctly than Verilog16:50
whitequarkso much so that nMigen doesn't bother with the latter16:50
FL4SHKThere are certain advantages to spitting out behavioral Verilog16:50
whitequarkyeah?16:51
FL4SHKOne of them is that it's perhaps easier to debug the compiler :P16:51
FL4SHKI plan on using the \identifier feature of Verilog16:51
whitequarkoh, nMigen does output a .debug.v file next to every .il file16:51
whitequarksince in most cases the converted Verilog is enough16:51
whitequarkit's just that it "outsources" the complexity of writing correct Verilog to Yosys16:52
FL4SHKMy language is actually defined in terms of Verilog16:52
FL4SHKi.e. simulation, for example, uses Verilog semantics16:52
FL4SHKthe `module` keyword, in my language, is equivalent to a single `module` in Verilog16:53
whitequarkfull disclosure: I think just about everything about Verilog is awfully designed16:53
FL4SHKI think it's fine as a compilation target.16:53
whitequarkso in my eyes, that's a strict downside of your language, though there could be reasons why it's necessary16:53
FL4SHKIt's pretty terrible for actually developing stuff in16:53
whitequarkI think it's even worse as a compilation target than for developing things in16:53
FL4SHKMaybe our viewpoints are different16:54
whitequarkit is unable to represent most of the interesting semantics while having so much nonessential complexity that tooling is nearly always incorrect16:54
FL4SHKIt's pretty terrible16:54
FL4SHKI see16:54
whitequarkI think the way 1364.1 defines a DFF with async set and reset is very enlightening16:54
whitequarkit *requires* you to write a code with sim/synth mismatch16:54
whitequark*write a code pattern16:55
FL4SHKThat's uh16:55
FL4SHKThat's unfortunate16:55
whitequarkmeanwhile there's no well-defined "compilation target" subset at all with SystemVerilog, which is even worse than the poorly defined compilation target defined in 1364.116:55
FL4SHKI've never really run into simulation/synthesis mismatches16:56
whitequarkwhich SV constructs do I have to implement to ingest the output of your HDL? well, the only way is to look at the sources of your tool16:56
whitequarkmultiply by the number of tools.16:56
whitequarkthere are tools that supposedly ingest Verilog that can't cope with concatenations on assign LHS16:56
FL4SHKwhat16:56
FL4SHKI use that too frequently16:56
whitequarkthere's a yosys issue, moment16:56
FL4SHKyosys doesn't support that?!16:57
whitequarkhttps://github.com/YosysHQ/yosys/issues/128616:57
tpbTitle: Yosys emits assigns with a concatenated expression on the LHS · Issue #1286 · YosysHQ/yosys · GitHub (at github.com)16:57
whitequarkyosys does16:57
whitequark*other tools* don't16:57
FL4SHKah16:57
FL4SHKIcarus Verilog supports it just fine16:57
FL4SHKassigning to a concatenation isn't even difficult, though, tbh16:57
whitequarkIcarus supports nearly all of 1364, I think16:57
whitequarkI'm talking about using Verilog as a compilation target16:57
FL4SHKI always miss that feature of Verilog when I write VHDL16:57
whitequarkit requires you to emit code readable by the lowest common denominator of every possible tool16:58
FL4SHKQuartus supports it just fine16:58
whitequarksince there's no actual spec for "structural Verilog"16:58
FL4SHKI wonder how well Verilator does16:58
whitequarkit does support that16:58
FL4SHKWhat about Vivado?16:58
whitequarkthe tool from #1286 is OpenSTA16:58
whitequarkhttps://github.com/The-OpenROAD-Project/OpenSTA this one I think16:59
tpbTitle: GitHub - The-OpenROAD-Project/OpenSTA: OpenSTA engine (at github.com)16:59
FL4SHKI'll make RTLIL a primary goal16:59
whitequarkRTLIL is *much* better than Verilog as a compilation target, though still imperfect because its semantics are pretty much just "what Yosys does"17:00
whitequarkI've spent quite a while nailing it down in the manual and tightening the verifier in Yosys, but there are still parts left that are underdefined17:00
FL4SHKI didn't know that concatenations being assigned to was so poorly supported.17:00
FL4SHKThat strikes me as very unfortunate because it's such a nice thing17:00
whitequarkI think it's supported in most tools you might encounter17:00
daveshahThis isn't a problem with synrhesis tools17:00
whitequarkthat's not the problem I'm talking about17:00
daveshahIt's a problem with the undefined nature of "structural Verilog"17:01
whitequark^17:01
FL4SHKMaybe I'll add in support for spitting out VHDL17:01
whitequarkpersonally I'm looking forward to better support of FIRRTL across the board, because it has well-defined semantics, a spec you can verify conformance to, and a specific compilation target subset17:02
whitequarkbut... it's just not there yet17:02
FL4SHKI'll have to give that a try, too.17:07
*** vidbina has quit IRC17:13
*** Cerpin has quit IRC17:19
*** emeb_mac has joined #yosys17:19
*** dys has joined #yosys17:29
*** emeb_mac has quit IRC17:37
az0rewhitequark: I think some of what you just wrote should be pasted into issue #2004, especially the part about 1364.1 requiring a code pattern that guarantees sim/synth mistmatch17:43
whitequarkI assumed this all is well-known among tooling developers, I think, but you have my permission to paste as you see fit17:46
*** Cerpin has joined #yosys18:03
ZirconiumX[17:56:46]  whitequark: there are tools that supposedly ingest Verilog that can't cope with concatenations on assign LHS <--- Quartus in VQM (Verilog Quartus Mapping) mode won't accept it either18:03
ZirconiumXVQM looks a lot like Verilog '95 except incredibly sucky.18:03
ZirconiumXOr maybe that's just an inherited property of Verilog '9518:05
whitequarkFL4SHK: ^18:07
ZirconiumXIt's not even much faster to parse than using the full SV parser that Quartus has.18:10
ZirconiumXThe speed gain - as far as I can tell - comes from avoiding megafunctions18:11
awyglewhitequark: "but [FIRRTL]'s just not there yet" can you elaborate on what you feel is missing?18:46
FL4SHKawygle:  wait, you're on IRC now?18:52
awygleFL4SHK: i've been on IRC longer than discord :p18:52
FL4SHKsame18:53
FL4SHKbig same18:53
whitequarkawygle: tooling support18:53
whitequarkyosys doesn't have a firrtl frontend.18:53
FL4SHKso, not a problem with FIRRTL itself18:53
FL4SHKfrontend?  why not a backend?18:53
FL4SHKoh wait18:53
FL4SHKderp, derp18:53
whitequarkboth frontend and backend18:53
whitequarkthe backend exists18:53
whitequarkthe frontend does not18:53
FL4SHKI see.18:53
FL4SHKI'll probably jump straight into FIRRTL, then, when I decide to output not-Verilog18:54
FL4SHK...though perhaps I'll switch to outputing a non-optimized netlist18:54
FL4SHKnetlist Verilog is hopefully well-supported, eh?18:55
FL4SHKOh well18:55
whitequarkstructural Verilog is what i think i'm calling what you call netlist Verilog18:56
FL4SHKI see.18:56
awygleanything besides the missing yosys frontend? (i am sad that "yosys frontend missing" == "bad tooling support" but i can't argue with its accuracy)18:56
whitequarkawygle: sure18:56
whitequarknextpnr doesn't take LoFIRRTL either, though it morally ought to18:56
whitequarkcan I simulate FIRRTL?18:56
whitequarkcan I feed it to basically any extant tool that takes structural Verilog currently?18:57
whitequarkVerilator?18:57
whitequark(Verilator equivalent, anything)18:57
whitequarkanalyzers? generators? anything?18:57
whitequarkmy impression of FIRRTL is that at the moment it's a (good!) spec that exists in a near vacuum18:57
awygleall fair points. all of this besides the nextpnr bit applies just as well to RTLIL, which is what i was implicitly contrasting it with18:58
awygleshould have been more explicit18:58
whitequarkright, so the main difference with RTLIL is that RTLIL isn't really trying to be an interchange format18:58
awygleRTLIL can be converted to inputs for all of those tools of course but if you assume a yosys frontend then so can firrtl18:58
awyglemhm18:58
awyglei getcha18:58
whitequarkhm, ok, so there's an interpreter for FIRRTL, in Scala18:59
awyglei think we agree on our assessments of FIRRTL which is all i really wanted to confirm. you have a lot more experience wrt language stuff than me, so i wanted to see if there were deficiencies i was missing.18:59
whitequarknope, actually FIRRTL has a few things that gave me inspiration for improvements in nMigen19:00
FL4SHKIs there anything really wrong with me using an existing HDL in place of my own until my own is done?19:01
FL4SHKFor some reason it makes me uncomfortable to just start using another HDL, like it's morally wrong or something19:01
whitequarkabsolutely nothing wrong19:01
FL4SHKI honestly really want to start doing some HDL work19:01
FL4SHKI've got my job, sure19:02
FL4SHKbut I don't really get to pick what I work on there19:02
whitequarkin fact, using other languages daily makes you better suited to work on your own19:02
whitequarkas you get to see more perspective19:02
awygleFL4SHK: my opinion is that if you haven't done a fair amount of work in one of the existing HDLs you will probably not succeed in solving their problems, at least not immediately19:02
awyglealthough we have a counterexample right above that message so :shrug:19:02
FL4SHKawygle:  most of my HDL stuff has been CPUs19:03
FL4SHKat work we don't just write HDL code19:03
FL4SHKthough I guess how much HDL code we write depends on if you count UVM stuff as HDL code or not, haha19:03
whitequarkawygle: i did *some* verilog work, really just enough to see where the pain points are19:03
FL4SHKlack of custom types19:03
FL4SHKSystemVerilog pain point:  lack of parameterizable custom types19:04
awyglepersonally, my experiences with the OSS HDL community have lead me to near-total indifference to languages as such19:04
whitequarkawygle: probably less than someone else would need because i tend to go straight for the pain points19:04
awyglei am much, _much_ more interested in the surrounding ecosystems19:04
whitequarknevertheless, if i worked more with VHDL, i would have solved some problems in nMigen earlier19:04
FL4SHKMaybe I'll give VHDL work more of a try19:04
whitequarkVHDL's simulator is nothing short of brilliant19:05
FL4SHKwhich simulator?19:05
whitequarkhttps://insights.sigasi.com/opinion/jan/vhdls-crown-jewel/19:05
tpbTitle: VHDL's crown jewel - Sigasi (at insights.sigasi.com)19:05
whitequarkVHDL's simulation semantics19:05
FL4SHKoh, yes.19:05
whitequarkthe main problem with VHDL's semantics is that you still have to balance clock trees19:05
FL4SHKThose seem to be very well defined.19:06
whitequarkwhich is something I hope to improve on19:06
whitequarkbut the basic mechanism is used in nMigen nearly intact and it works extremely well19:06
FL4SHKWhat do you mean by clock trees?19:06
FL4SHKAnd what is balancing them?19:07
whitequarkimagine a behavioral clock gating primitive in VHDL19:07
FL4SHKan if statement?19:07
whitequarkit'll have a combinatorial path from input clock to output clock, right?19:07
whitequarkanything. an if statement works, i think19:07
FL4SHKclock gating... is that the same thing as a clock enable?19:07
whitequarkno19:07
FL4SHKHm, I see19:08
FL4SHKI don't think I've done anything other than clock enables.19:08
FL4SHKWhat is clock gating?19:08
whitequarka clock enable is a way to enable or disable some logic driven by the same clock signal as other logic. in other words, a clock enable is just a normal combinatorial input to your synchronous logic19:09
FL4SHKRight.19:09
whitequarkyou can represent it by wrapping every dff with a muxed path19:09
whitequarkthat works just fine19:09
whitequarkin comparison, clock gating produces *another* clock, so your logic is now driven by two clock signals. however, when the gate is enabled, these two clocks are completely in-phase, at least in hardware19:10
whitequarkunfortunately, if you implement it naively in VHDL, the output clock will lag one delta cycle behind the input clock19:10
whitequarkso if you have a DFF driven by the gated clock capturing the output of a DFF driven by the ungated clock, you'll capture the wrong value19:11
FL4SHKIt sounds to me like clock gating is something you don't want to do in an FPGA19:11
whitequarkit'll be as if there is an infinitesimal but nonzero phase difference between the input (ungated) and output (gated) clock19:11
FL4SHKgiven that you're not supposed to clock logic using other logic19:11
whitequarkwell, FPGAs have clock gating primitives.19:11
whitequarksome FPGAs.19:11
FL4SHKI see19:11
whitequarkXilinx has BUFGCE19:11
whitequarkso you might want to simulate them19:11
FL4SHKSome FPGAs have internal tri-state stuff, too :P19:11
whitequarkI mean modern widely used FPGAs19:12
FL4SHKold ones, anyway19:12
FL4SHKI see, interesting19:12
FL4SHKso is that what you'd use to make a PLL in an FPGA's logic?19:12
whitequarkI don't think you can do that to make a PLL, *but* a simulated PLL would have the same problem19:12
whitequarkif e.g. the output of a PLL regenerates the input clock19:12
whitequarkor perhaps an integer ratio19:12
whitequarkwhat you really want is some way to tell the simulator "this comb input and this comb output are in-phase. the transitions should either propagate within one delta cycle, or within nonzero time, but not in different delta cycles but same instant"19:13
whitequarkVHDL doesn't have that19:14
FL4SHKThis is something I've never run into, myself19:14
FL4SHKBut I've never tried to create another clock outside of using a PLL19:14
whitequarkinstead what you do is to take your input clock, make a gated output clock (with one delta cycle delay), then make an ungated output clock (with one delta cycle dummy delay), then use just the last two19:14
whitequarkso, this problem is something you encounter in ASIC development, mostly, I think19:15
FL4SHKI definitely want to get into ASIC development at some point19:15
whitequarkI discussed it with some good VHDL and Verilog developers who did happen to hit it19:15
FL4SHKMOSIS is apparently as cheap as maybe $800 for 1 mm^219:15
whitequarkVerilog has blocking assignments, which allow you to express clock gating cleanly, but at the cost of determinism19:15
FL4SHKwhich is within my price range19:15
whitequarkCMP is even cheaper19:15
FL4SHKCMP?19:15
FL4SHKWhat's that?19:15
whitequarkhttps://mycmp.fr/19:16
tpbTitle: CMP: Circuits Multi-Projets (at mycmp.fr)19:16
FL4SHKI'll need to keep this in mind19:17
FL4SHKI've wanted to do ASIC development for a long time now.19:17
whitequarkanyway, the simulation issue I mentioned before primarily interests me from the perspective of bottom-up language correctness19:17
whitequarkit's not something that is insurmountable in practice19:18
whitequarkit's annoying and it does cause bugs, that's for sure19:20
whitequarkbut it's one of the lesser HDL footguns19:20
FL4SHKI've decided to do some HDL development in SystemVerilog, using sv2v so I can use yosys's formal verification.19:24
FL4SHKGHDL synthesis looks nice, too19:24
FL4SHKI like 'attr stuff in VHDL19:24
FL4SHKso I brought it into my HDL.19:25
*** oldtopman has quit IRC20:32
*** Cerpin has quit IRC20:35
*** Cerpin has joined #yosys20:36
*** Cerpin has quit IRC20:40
*** Cerpin has joined #yosys20:41
*** emeb_mac has joined #yosys20:45
*** adjtm has quit IRC20:56
*** adjtm has joined #yosys20:57
*** kraiskil has joined #yosys21:25
*** Asu has quit IRC22:10
*** az0re has quit IRC22:55
*** craigo_ has joined #yosys23:23
*** emeb has quit IRC23:38
*** az0re has joined #yosys23:51

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