Sunday, 2019-10-06

*** tpb has joined #yosys00:00
*** voxadam has quit IRC01:36
*** voxadam has joined #yosys01:40
*** PyroPeter has quit IRC02:13
*** PyroPeter has joined #yosys02:27
*** attie has joined #yosys03:11
*** attie has quit IRC03:16
*** jkiv has joined #yosys03:29
*** jkiv has quit IRC03:32
*** jkiv has joined #yosys03:33
*** jkiv has quit IRC03:37
*** citypw has joined #yosys04:38
*** _whitelogger has quit IRC04:45
*** _whitelogger has joined #yosys04:47
*** _whitelogger has quit IRC05:24
*** _whitelogger has joined #yosys05:26
*** _whitelogger has quit IRC05:42
*** _whitelogger has joined #yosys05:44
*** _whitelogger has quit IRC06:03
*** _whitelogger has joined #yosys06:05
*** emeb_mac has quit IRC06:16
*** craigo has quit IRC06:33
*** Jybz has joined #yosys06:46
*** _whitelogger has quit IRC07:03
*** _whitelogger has joined #yosys07:05
*** attie has joined #yosys11:13
*** attie has quit IRC11:17
*** fevv8[m] has quit IRC11:54
*** jryans has quit IRC11:54
*** pepijndevos[m] has quit IRC11:54
*** rjo has quit IRC11:54
*** nrossi has quit IRC11:54
*** fevv8[m] has joined #yosys12:06
*** attie has joined #yosys12:44
*** nrossi has joined #yosys12:58
*** jryans has joined #yosys12:58
*** pepijndevos[m] has joined #yosys12:58
pepijndevosWhat's the difference between Shl Shr Sshl Sshr Shift Shiftx?12:59
pepijndevosFrom the name I'd guess sshl is signed/arithmetic, but Shl also has a signed parameter...13:02
pepijndevosYea...manual+google suggests it's indeed arithmatic shift13:05
*** Jybz has quit IRC13:33
*** Jybz has joined #yosys13:36
*** stzsch has quit IRC13:48
*** attie has quit IRC14:08
*** lutsabound has joined #yosys14:09
pepijndevosWould love to chat with someone familiar with memory interference how to map HDL to memrd and memwr and mem and rtlil::Memory stuff14:11
whitequarksure14:12
whitequarki implemented that in nmigen14:12
pepijndevosyay14:12
pepijndevosso I'm looking at GHDL and how to map that to yosys constructs14:12
whitequarkre shift/shiftx: i believe that's the same as shr, except it maps to the verilog indexed part-select construct14:12
whitequarki'm not sure if yosys ever emits shift (as opposed to shiftx)14:12
pepijndevosSo if I make an 1024 array of 8 bit elements, it gets synthesized into a 8191 lenght flat vector14:13
pepijndevosthen there is a memidx primitive that seems to translate and index to the flattened array14:14
whitequarkhmm14:14
whitequarkthat seems troublesome14:14
pepijndevosand there is a dyn_extract and dyn_insert that is basically a non-constant array lookup14:14
pepijndevosSo in yosys, is memory of a specified dimension?14:16
whitequarkyep14:16
pepijndevosHrm... I can maybe discuss with Tristan to delete the whole flattening and memidx step14:17
pepijndevosBut okay, so either I need to "unflatten" that or skip that step in GHDL14:18
pepijndevosSo say I have just an array of std_logic_vector, how would I map that to yosys memory things?14:19
whitequarklet's see14:20
*** attie has joined #yosys14:21
whitequarkpepijndevos: right, so, you could map either to $mem cells, or $memrd/$memwr/$meminit14:23
whitequarkdo you know which one is closer to your existing IR in that case?14:24
whitequarki.e. how does GHDL represent ports?14:24
pepijndevosAs far as I understand, currently there is no "port" per se, but a dyn_extract and dyn_insert primitive that are basically arra[idx] and array[idx]=val14:26
whitequarkok14:27
whitequarkthose map directly to $memrd and $memwr14:27
whitequarkbasically you assign some index to each distinct `array` and use it as \MEMID parameter14:27
pepijndevosSo do you need to convert arrays to RTLIL::Memory instances?14:28
whitequarknope14:29
whitequarki mean, you could14:29
whitequarksoryr14:29
whitequark*sorry, you do14:29
whitequarkI misremembered how this works14:29
whitequarkeach memory is converted to RTLIL::Memory, and then $memrd/$memwr ports are associated to it by name (via \MEMID)14:30
whitequarkthe geometry of the memory is duplicated, for RTLIL::Memory and then in each port14:30
pepijndevosHm okay14:31
pepijndevos(I have NO idea what would map to meminit in VHDL)14:32
whitequarkhow do you initialize memories in VHDL?14:32
pepijndevosI googled it and I'm still not sure... you pretty much don't??? Or in some vendor specific way or something that only works in simulation.14:33
whitequarkhuh14:33
ZirconiumXThat's odd.14:33
pepijndevosLike... there isn't anything like readmemb() either14:34
pepijndevosso people just reset arrays in reset and do manual file IO bs14:34
ZirconiumXAnd I almost had respect for VHDL :P14:35
whitequarkreset arrays in reset?14:35
pepijndevosYea, like you reset other values... if reset memory = initial value, doesn't map to bram in any useful way...14:36
ZirconiumXSo it gets initialised by logic?14:37
ZirconiumXThat's, uh, not great.14:37
*** Xiretza has joined #yosys14:37
whitequarkI'm thinking it is mostly ASIC-geared then14:38
ZirconiumXI mean, it was originally written for ASICs, but I would have thought they'd expand it to handle this14:40
daveshahIt definitely supports initialised registers14:41
daveshahWith a := value after the signal declaration14:41
*** umarcor has joined #yosys14:41
daveshahI'm pretty sure this works for initialised BRAM too14:41
pepijndevosI guess you're right https://stackoverflow.com/questions/16607812/initializing-memory-in-netlist-vhdl14:53
tpbTitle: synthesis - Initializing memory in netlist VHDL - Stack Overflow (at stackoverflow.com)14:53
pepijndevosAlso, "Initializing RAM contents" here has a function for reading from disk in VHDL https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_1/ug901-vivado-synthesis.pdf14:55
umarcor@pepijndevos, I think the reason to use IO for simulation is that the same functions can be used to read different data files, instead of copying large sets of raw values in the codebase. however, I've seen packages used to define constants (memory initialization values) only.14:55
*** attie has quit IRC14:57
umarcorregarding initialization of BRAMs (as opposed to arrays of registers), I think that it is vendor-specific. IIRC, Xilinx (ISE or Vivado) will populate the BRAM with the values you define either as @daveshah commented, or with the reset values of the process from where the BRAM is inferred. I don't know which one is picked when both exist.14:58
umarcorwhen the BRAM is defined as an IP-core in Vivado, a bin or hex file can be provided.14:59
umarcorlast, cli tools exist to overwritten the initialization values of BRAMs in bitstreams. these are provided in the SDK, since they are meant for software developers that don't have access to the sources of the hardware design. I'm afraid that none of this is open source.15:00
whitequarkicestorm has such an open source tool15:00
whitequarkcalled "icebram"15:00
umarcorexactly15:00
*** dys has joined #yosys15:00
umarcorbut it targets lattice device only, for now, isn't it?15:01
whitequarkicestorm targets ice40 specifically15:01
umarcoris the reverse engineering effort around xilinx's 7 series mature enough to adapt it?15:01
mwkhmm15:02
mwkhow does icebram know which blockram to target?15:02
whitequarki know very little about xilinx, but i thought the BRAM frames were among the easiest to work with15:02
whitequarkmwk: you fill it with a pattern first15:02
mwkew15:02
whitequarkyou have to do it because the geometry may change quite a bit15:02
whitequarke.g. yosys can change aspect ratio and duplicate BRAMs15:03
mwkbecause of address lines being swizzled?15:03
mwkhmm15:03
whitequarkand that too15:03
mwktbh that sounds like something we should invent a metadata format for15:03
whitequarkpossibly, but i think the approach of filling it with a pattern works fine15:03
mwkfeels hacky15:03
whitequarkas long as you always have an unique mapping, is it?15:04
mwkunique mapping?15:04
mwkyou just said that brams can get duplicated15:05
whitequarki mean, as long as the pattern is sufficiently random that you don't get collisions15:06
* mwk was considering something some time ago15:06
mwka "relocation" mechanism15:06
mwkmark a BRAM / LUT / generic attribute as "to be resolved later" somehow in .v15:06
mwklet it pass through synth + pnr unchanged15:06
mwkand have it resolved at bitstream creation point15:07
whitequarkvivado has almost this, no?15:07
whitequarkwhere you can manipulate post-synthesis netlist15:07
mwksort of, yes15:07
whitequarkgive your BRAM or LUT an attribute and grab it with tcl15:07
mwkhmm15:07
mwkright, that would work15:07
mwkanyhow, the "relocation" approach would work for things smaller than whole blockrams, ideally15:08
mwklike single LUTs15:08
mwkor, the case I was thinking of, PLL parameters15:08
whitequarkyes, sb used it for PLL parameters15:09
mwkso you can tune your PLL without re-pnring and changing timing in the process15:09
whitequarkwhen the bitstream would build for hours15:09
mwksb?15:09
whitequarksebastien from m-labs15:09
mwkoh15:10
pepijndevoswhitequark, talking to Tristan now, and the worry is that some uses of 2D array don't map to memories, and Yosys doesn't do 2D arrays apparently. So the only general approach seems to flatten everything and then have a whole pass to extract and unflatten memories -.-15:11
pepijndevos(https://gitter.im/ghdl1/Lobby)15:11
tpbTitle: ghdl1/Lobby - Gitter (at gitter.im)15:11
whitequarkwhat is a 2D array15:12
mwkint a[20][20];15:13
whitequarkpersonally, i think that the propensity of HDL toolchains to leave the most important properties of your design (like whether something gets mapped to BRAM) to "inference" is one of the absolute worst things about them15:13
whitequarkbut people seem to like that approach anyway, so i guess go for it15:13
pepijndevosYea, so from what I gather in Verilog `reg [20] foo [8]` indicates an array of 20 elements of 8 bits, but VHDL doesn't really have a distinction like that. You just make arrays or arrays of arrays of arrays of bits15:14
mwkpepijndevos: 8 elements of 20 bits, and you write it as reg[19:0] foo [0:7]15:15
mwkand in systemverilog IIRC you can do reg[19:0] foo [0:7][0:9]15:15
mwkand as for xilinx and memory frames, uh15:20
mwksuppose you want to make a xilinxbram tool15:21
pepijndevosSo how does yosys decide what to do with a reg [x:y] foo [a:b]? Does that always become a memory, or can you do non-memory things to it that cause it to just become logic?15:21
mwkfirst, you get to parse and re-emit the bitstream15:21
mwkwhich requires full geometry information about the chip already15:21
mwkthis implies a big chip database15:21
Xiretzamwk: that's what https://github.com/SymbiFlow/prjxray is about15:22
tpbTitle: GitHub - SymbiFlow/prjxray: Documenting the Xilinx 7-series bit-stream format. (at github.com)15:22
mwksecond, you need a map of the bits in a blockram tile and information about the particular arrangement15:23
emilyI think mwk might be a little familiar with Xilinx reverse-engineering efforts...15:23
whitequarklol15:23
mwkwhich depend on many things15:23
mwkmostly 18k vs 36k size and TDP vs SDP15:23
mwkI've looked at the blockram bits geometry, and... I suppose there is some logic to it, but it mostly looks like a big mess15:24
mwkanyhow, such a tool can definitely be done15:25
mwkatm I think I have enough data to do that for everything from xc2v up to xc715:26
Xiretzaemily: hah, woops. I don't really follow the developments very closely and didn't associate the name :)15:26
mwkbut that's quite a bit of effort, and given that both ISE and Vivado already include such a tool, I don't see it as high-priority15:26
*** emeb has joined #yosys15:34
*** craigo has joined #yosys16:11
*** gkh has joined #yosys16:22
*** citypw has quit IRC17:40
*** Jybz has quit IRC18:57
*** Jybz has joined #yosys18:59
mwkthat may be a stupid question, but... what does "coarse-grain synthesis" refer to in yosys? (looking at splice and connwrappers command help)19:02
whitequarkmwk: synthesis to multibit cells19:04
whitequarklike there's $and which has n-bit inputs and outputs19:04
whitequarkand $_AND_ which has strictly 1-bit19:05
mwkoh, just that19:07
mwkstill don't understand what these two commands are useful for, though...19:07
mwkthey don't seem to be called in the course of normal synthesis19:08
mwk"This command adds $slice and $concat cells to the design to make the splicing of multi-bit signals explicit. This for example is useful for coarse grain synthesis, where dedicated hardware is needed to splice signals."19:09
mwkok, I definitely don't understand what dedicated hardware that would be19:09
daveshahCoarse grain reconfigurable arrays19:28
daveshahWhich I guess might be based on buses internally and therefore have special resources for manipulating those buses19:28
whitequarkhuh, never heard of those. any links?19:28
emilyI think it was meant as a hypothetical?19:29
emilyapparently not19:29
daveshahI don't think there are any you can buy19:29
daveshahLots of papers19:29
mwksome crazy research thing?19:30
mwkah, figures19:30
daveshahI think some modern apps processors have structures a bit like them for image sensor pipelines etc19:30
daveshahBut good luck finding any docs or info for them19:30
whitequarkhttp://cccp.eecs.umich.edu/research/cgra.php lmao this logo19:31
tpbTitle: CCCP: Coarse-Grained Reconfigurable Architecture (at cccp.eecs.umich.edu)19:31
mwkdid they seriously..19:32
mwkoh19:32
mwkthey did19:32
mwkanyhow, this does answer my question19:33
mwkdaveshah: thanks19:33
daveshahI'm not convinced how useful something like Yosys would be for commercial CGRAs19:34
mwkI still wonder how we ended up with these passes19:34
daveshahAs far as I can tell from a   quick search, hacking LLVM seems to be more popular as an approach19:34
daveshahI think Clifford did some work with TU Wien people on them19:34
daveshahhttp://www.clifford.at/intersynth/19:35
tpbTitle: InterSynth - Example-Driven Interconnect Synthesis (at www.clifford.at)19:35
daveshahMight be related19:35
*** dys has quit IRC20:23
cr1901_modernDat hammer-and-sickle...20:32
*** Jybz has quit IRC20:36
*** dys has joined #yosys20:43
*** emeb_mac has joined #yosys20:46
*** umarcor has quit IRC21:10
*** craigo has quit IRC22:34
*** craigo has joined #yosys23:23
*** gnufan_home has joined #yosys23:28
*** gnufan_home has quit IRC23:42

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