Sunday, 2019-05-26

*** tpb has joined #yosys00:00
mithroDoes anyone know how to write a sync write, async read DP ram that yosys will understand?00:15
mithroI'm going via the "   Number of memories:               0" output that I'm not ending up with memories?00:20
mithroZipCPU / daveshah: You seem to know these sort of things... I have the following Verilog at the moment ->
tpbTitle: dpram32.sim.v · GitHub (at
ZipCPUmithro: Are you trying to build a new architecture?  I know how to get Yosys to synthesize a current architecture01:14
mithroZipCPU: Maybe if I had an example I could understand how to do what I'm after?01:23
ZipCPUmithro: This is what I have, which would answer your question if you weren't trying to extend yosys or build a new architecture:
tpbTitle: Formally Verifying Memory and Cache Components (at
ZipCPUI also have "rules of memory usage" in my tutorial01:24
ZipCPUIf you are trying to expand Yosys to support new chips or new hardware, then you'd have to ask daveshah, since I don't have that background01:25
mithroZipCPU: I'm not really understanding how to read that post you linked?01:33
ZipCPUNo?  What are you missing?01:33
ZipCPUIt describes how to describe a memory in Verilog, which Yosys will then infer within hardware01:34
mithroZipCPU: The first heading on that page is "Formal Verifying Memory-like Components", then it moves onto talking about caches....01:49
ZipCPU... and then it goes through the design of a memory, that it then formally verifies01:50
ZipCPUThe memory design that's referenced should be: IIRC01:50
tpbTitle: zbasic/memdev.v at master · ZipCPU/zbasic · GitHub (at
mithroZipCPU: It is also missing a lot of information about things that I would assume need to be explained, IE I assume AW == Address Width? and DW == Data Width? It never seems to describe how and where `mem` object is defined?01:51
ZipCPUAW = address width, DW = data width01:52
ZipCPULet me get a link for the memory definition ...01:52
ZipCPUHere's the memory definition itself:
tpbTitle: zbasic/memdev.v at master · ZipCPU/zbasic · GitHub (at
*** gsi__ has joined #yosys01:54
mithroZipCPU: I think the thing I actually want is
*** gsi_ has quit IRC01:56
mithroZipCPU: Yeap! That tutorial has the info I need02:01
ZipCPUAhh ... okay02:03
*** cr1901_modern has quit IRC02:09
*** cr1901_modern has joined #yosys02:13
*** Cerpin has joined #yosys02:14
*** lutsabound has joined #yosys02:14
mithroZipCPU: This is what I have ended up with ->
tpbTitle: dpram32.sim.v · GitHub (at
mithroZipCPU: I assume the "32 -> BUF -> i" is the initialization data for the memory?02:19
mithroI'm not sure this line is right ->
tpbTitle: dpram32.sim.v · GitHub (at
ZipCPU32 -> BUF -> i .... which reference was that in?02:26
mithroZipCPU: See the image attached to that gist...02:26
ZipCPUAhh ... .okay02:27
ZipCPUWhat's going on with the $mux on the WR_EN line?02:27
ZipCPUThat looks a bit superfluous02:28
ZipCPUOh, I think I see what's going on with I02:28
mithroZipCPU: Oh?02:29
ZipCPUThe 32->BUF->i is the value "i" has at the end of the for loop, right?  Where ADDR_LENGTH = 3202:29
mithroZipCPU: Oh... yes...02:29
ZipCPUSo, ever after, if "i" is referenced it will have the value of 3202:29
mithroHow do I make it "go away" :-P02:29
ZipCPUWe recently had some ugly bugs we needed to deal with dealing with loop variables, and I think that was part of the solution02:29
ZipCPUPerhaps opt_clean ?02:29
ZipCPUI think there's an opt_muxtree pass that might even remove the $mux on WR_EN too02:30
mithro2.11.4. Executing OPT_CLEAN pass (remove unused cells and wires).02:31
mithroFinding unused cells or wires in module \DPRAM32..02:31
mithroI did a `prep -top DPRAM32 ; show -format svg -prefix DPRAM32`02:31
ZipCPUThere's also a "synth" command, which might've made more sense02:32
mithroZipCPU: It seems like synth flattens that mem into DFF and a bunch of other cells...02:38
ZipCPU... which could be quite appropriate, depending upon the actual memory in your device02:39
*** PyroPeter has quit IRC02:43
mithroZipCPU: I can't see anything in the Yosys manual which would remove that `integer i`?02:47
ZipCPUThe "integer i" probably wasn't there when the yosys manual was written.  I think it was a rather recent addition.02:51
*** PyroPeter has joined #yosys02:56
mithroZipCPU: Is this the same?03:03
tpbTitle: Snippet | IRCCloud (at
ZipCPUThat's the integer i, if that's your question03:03
ZipCPUI know I found some problems with it while building the crossbar I've been working on, which led to this more complete definition03:04
ZipCPUIf my case, I had loops upon loops upon loops that all used the same loop variables.  That required that the loop variables be kept03:04
ZipCPUWe also had a user complaint about a reference to the loop variable after the loop ended that was ... eye opening.03:05
ZipCPUIt was one of those, well, gee, I never thought anyone would do that moments03:05
ZipCPUThat's part of the reason why "i" isn't limited to just the loop alone03:05
ZipCPU... and why it continues to have a definition now that the loop is complete03:06
mithroWell, when using genvar it doesn't end up in the output verse the "integer i"?03:06
mithroZipCPU: Interestingly, when I changed it to a generate statement, the linter warned me I had gotten the parameter size wrong...03:07
*** lutsabound has quit IRC04:34
*** vonnieda has joined #yosys05:13
*** gsi__ is now known as gsi_05:25
*** rohitksingh has joined #yosys06:36
*** rohitksingh_ has joined #yosys07:10
*** rohitksingh has quit IRC07:11
*** rohitksingh_ has quit IRC07:11
*** MoeIcenowy has quit IRC07:28
*** MoeIcenowy has joined #yosys07:28
*** vonnieda has quit IRC08:21
*** _whitelogger has quit IRC10:32
*** _whitelogger has joined #yosys10:34
*** maikmerten has joined #yosys11:06
*** MoeIcenowy has quit IRC11:20
*** MoeIcenowy has joined #yosys11:20
*** _whitelogger has quit IRC11:29
*** _whitelogger has joined #yosys11:31
*** maikmerten has quit IRC12:42
*** MoeIcenowy has quit IRC12:47
*** MoeIcenowy has joined #yosys12:47
*** MoeIcenowy has quit IRC12:52
*** MoeIcenowy has joined #yosys12:52
*** _whitelogger has quit IRC14:11
*** _whitelogger has joined #yosys14:13
*** emeb has joined #yosys14:57
*** vonnieda has joined #yosys16:19
*** Laksen has joined #yosys16:23
*** vonnieda has quit IRC20:08
*** vonnieda has joined #yosys20:13
*** Laksen has quit IRC20:26
*** vonnieda has quit IRC22:45
*** emeb has quit IRC23:22

Generated by 2.13.1 by Marius Gedminas - find it at!