lexano has quit [Remote host closed the connection]
lexano has joined #yosys
krispaul has quit [Quit: WeeChat 3.5]
kristianpaul has joined #yosys
FabM has quit [Ping timeout: 276 seconds]
bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
bjorkintosh has joined #yosys
danderson has joined #yosys
<danderson>
Hi! I need to write a sim model for ECP5's DP16KD. Beyond "look at what other FPGA memory sims do and be consistent with those", any docs/styles I should follow to make it a useful contrib to yosys?
<danderson>
I _think_ I understand the primitive's behavior enough to take a stab at the model, just wondering if there's any well known gotchas or style rules I should obey.
<lofty>
danderson: I think my advice would be to remember you're not writing a simulation model, as paradoxical as that is
<lofty>
Yosys will read and parse the sim model from a synthesis point of view, so if you throw in a bunch of simulation-specific things Yosys might just reject the model outright
<danderson>
lofty: hm, interesting. That complicates things a bit, because the model requires doing illegal things with clock domain crossing to detect misuses...
<danderson>
sounds like that might make yosys quite mad, or trigger incorrect optimizations?
<danderson>
I guess I'll start hacking and see how it does. I assume that means I should also not use '?' values to represent states where the hardware says the state is undefined?
<danderson>
Sounds like I should print a warning and pick a binary state instead
<lofty>
I assume that means I should also not use '?' values to represent states where the hardware says the state is undefined? <-- doing this is entirely okay
<lofty>
danderson: ^
<lofty>
(although, I assume you mean 'x', and not '?' AKA 'z')
<danderson>
er yes sorry, I've been bouncing between languages too much. I mean the state to represent "you maybe just did a metastability, that's bad" :)
<lofty>
e.g. the Yosys memory inference code detects conditional x for at least one use case
<danderson>
right on. The other thing I'm not sure how to express is async reset and reset release, but my plan there was to look at other models and... generally go learn how to do it.
<danderson>
But I understand the internal memory layout and I think I know how to detect the read-write and write-write port conflicts, which I think are the main spicy parts of this primitive.