hwpplayer1 has quit [Remote host closed the connection]
<vancz>
Can I read somewhere about what kind of techniques are used to compile verilog to rtl? Specifically the uh...layer that implements whatever it is that is done to match the "procedural" verilog code to synthesized primizives?
<vancz>
primitives
<vancz>
In general, to satisfy my curiosity.
<vancz>
(and how this results in unintuitive synthesis insanity)
emeb_mac has quit [Quit: Leaving.]
FabM has joined #yosys
FabM has joined #yosys
remexre has quit [Read error: Connection reset by peer]
remexre has joined #yosys
kristianpaul has quit [Ping timeout: 248 seconds]
krispaul has joined #yosys
hwpplayer1 has joined #yosys
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #yosys
FabM has quit [Ping timeout: 265 seconds]
hwpplayer1 has quit [Remote host closed the connection]
FabM has joined #yosys
FabM has joined #yosys
FabM has quit [Ping timeout: 265 seconds]
FabM has joined #yosys
FabM has joined #yosys
hwpplayer1 has joined #yosys
babo67_ has quit [Remote host closed the connection]
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #yosys
whitequark[cis] has joined #yosys
<whitequark[cis]>
basically every vendor does their own thi g
<whitequark[cis]>
s/thi g/thing/
<whitequark[cis]>
what yosys does is kind of some of the worst implementations I think
<whitequark[cis]>
just look at the recently filed memory init issue
hwpplayer1 has quit [Remote host closed the connection]
sorear has quit [Ping timeout: 252 seconds]
edm has quit [Ping timeout: 272 seconds]
edm has joined #yosys
sorear has joined #yosys
emeb_mac has joined #yosys
hwpplayer1 has joined #yosys
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #yosys
hwpplayer1 has quit [Remote host closed the connection]
hwpplayer1 has joined #yosys
hwpplayer1 has quit [Read error: Connection reset by peer]
krispaul has quit [Quit: WeeChat 3.5]
kristianpaul has joined #yosys
hwpplayer1 has joined #yosys
hwpplayer1 has quit [Remote host closed the connection]
<vancz>
aw, yosys being the worst saddens me a bit
<vancz>
is there any theory on how it _should_ be done?
<vancz>
Is what Im asking about called the elaboration step?
<jix>
there's elaboration as defined by the system verilog spec and elaboration as used in (parts of?) the industry
<jix>
the former is just about resolving and instantiating a bunch of things
<jix>
but often people seem to mean that + turning it into a netlist using primitives corresponding to the used HDL operations (or synthesizable patterns) but what those primitves are would already differ between tools
<jix>
vancz: if you want to see a much cleaner verilog -> RTLIL frontend than yosys's read_verilog (which I agree is bad) you could look at https://github.com/povik/yosys-slang
<jix>
it uses an independently developed system verilog frontend that does what the standard calls elaboration and separately does the translation of precedural stuff to netlist primitives
<jix>
I haven't read too much of yosys-slang, but what I looked at was quite readable and made sense
<vancz>
for the moment im more interested in high level descriptions, i have enough on my plate than to try to reverse engineer another codebase (right now), thanks though!
hwpplayer1 has joined #yosys
FabM has quit [Ping timeout: 246 seconds]
<jix>
one theoretical perspective of turning procedural hdl into netlists is to view it as symbolic interpretation
<jix>
it's a specific variant of it and there are some aspects that probably don't fit super well into that framework but I think that perspective can give a lot of useful intuition on how you'd even approach this
<jix>
the code you're interpreting is the procedural HDL and your symbolic value representation are netlists or operator DAGs or anything equivalent graph structured
<jix>
given the nature of HDLs and the retrofitted synthesis semantics, you also need to do some form of pattern matching for some synthesizable constructs and special case them (this is something where yosys's read_verilog does some things in the wrong order where it does some translation first and then pattern matches to detect things that shouldn't have been translated in that way...)
<jix>
uh and s/symbolic interpretation/symbolic execution/g
<jix>
there's also a somewhat related field of abstract interpretation which has some high level similarities to symbolic execution but the application of that would be for optimization and formal verification, not translation
hwpplayer1 has quit [Ping timeout: 244 seconds]
* vancz
nods
<vancz>
is it a thing for people to write hdl based on their own primitive library, and then retarget their model to different hardware by reimplementing the library
<vancz>
well, doing part of the synthesis tool's job manually basically
<vancz>
so idk, having a generic adder module and then for one target implementing a ripple carry adder and for another target using built in addition primitives, idk
<jix>
I haven't really seen that for generic logic like that, but for things that you don't want synthesis to mess with or don't trust synthesis to do the right thing with that's a thing that's done, can't tell how common it is though
<jix>
it seems super common to handle clock gating that way
<vancz>
whoops, wrong channel (hence the digression) but its fine