Wednesday, 2019-11-06

*** tpb has joined #yosys00:00
*** gatin00b has joined #yosys00:13
*** fsasm has quit IRC00:16
*** kraiskil has joined #yosys00:23
*** emeb_mac has quit IRC01:53
*** emeb_mac has joined #yosys01:56
*** PyroPeter has quit IRC04:02
*** kraiskil has quit IRC04:15
*** PyroPeter has joined #yosys04:15
*** kraiskil has joined #yosys04:18
*** _whitelogger has quit IRC05:27
*** _whitelogger has joined #yosys05:29
*** Jybz has joined #yosys05:45
*** citypw has joined #yosys05:52
*** FabM has joined #yosys06:41
*** kraiskil has quit IRC06:55
*** FabM_cave has joined #yosys07:02
*** emeb_mac has quit IRC07:07
*** Jybz has quit IRC07:27
*** citypw has quit IRC07:50
*** citypw has joined #yosys07:50
*** X-Scale` has joined #yosys07:58
*** X-Scale has quit IRC07:59
*** X-Scale` is now known as X-Scale07:59
*** voxadam has quit IRC08:37
*** voxadam has joined #yosys08:37
*** promach has quit IRC08:43
*** philtor has quit IRC08:52
*** FabM has joined #yosys08:58
*** FabM is now known as FabM_vace08:59
*** FabM_vace is now known as FabM_cave08:59
*** X-Scale has quit IRC09:19
*** X-Scale` has joined #yosys09:19
*** X-Scale` is now known as X-Scale09:20
*** kraiskil has joined #yosys09:58
*** citypw has quit IRC10:03
*** kraiskil has quit IRC10:15
*** fsasm has joined #yosys10:53
*** kraiskil has joined #yosys11:01
*** Stary has quit IRC11:16
*** X-Scale has quit IRC12:06
*** X-Scale has joined #yosys12:33
pepijndevosWhat's the discerning factor for getting a plugin into yosys-plugins or yosys proper?12:33
daveshahI don't think yosys-plugins has much in the way of criterea12:34
daveshahyosys itself would depend more on quality, dependencies, and portability12:34
daveshahOne option for features like the protobuf backend and python api is to have them in Yosys but disabled by default in the makefile12:35
daveshahIf they add unnecessary dependencies12:35
pepijndevosRight, like verific12:35
daveshahYeah12:35
pepijndevosI'm looking at CommandHandler, and it seems each subclass is responsible for its own bitstream output, prompting the question if asc files are in any way a well defined and preferred output format, or "whatever the packer takes as input"12:37
daveshahNo, asc files are a horrible format12:39
daveshahI would personally use fasm for any new architecture12:39
daveshahhttps://github.com/SymbiFlow/fasm12:39
tpbTitle: GitHub - SymbiFlow/fasm: FPGA Assembly (FASM) Parser and Generator (at github.com)12:39
daveshah(in many ways I don't love it, but it is a standard at least)12:39
pepijndevosOhhhh fancy12:40
pepijndevosSounds reasonable12:40
pepijndevosI did a call graph of nextpnr to figure out how stuff fits together, and I noticed a bunch of garbled Python stuff, what is that used for?12:41
daveshahIt's used for the Python API12:45
daveshahBut you can turn that off in the build if you don't want it complicating things12:45
pepijndevosI don't mind, I was just surprised to see it in a trace when not doing anything special. I suppose it's just setup code then, or is part of the ice40 flow using the Python API?12:49
daveshahNo nothing in the actual flow uses the Python API12:52
daveshahit's just initialised at startup as a Python script may be called later on in the flow (with one of the cmdline arguments like --pre-pack etc)12:52
pepijndevosHmmm, looking at fasm ther reference implementation is in Python. It looks simple enough to just printf though, so maybe what I'll do is just printf fasm in Nextpnr and write the packer in Python.12:55
daveshahPlease don't12:56
pepijndevosWhich part?12:56
daveshahThe Python API is somewhat by necessity a pain to build on certain platforms (windows)12:56
daveshahas a result many of the static builds prefer to exclude the python api12:57
daveshaha few weeks ago I added a way to specify timing constraints without python for this very reason12:57
daveshahOh wait, you mean C printf12:57
daveshahI thought you meant write  parts of the nextpnr flow in Python12:57
pepijndevosYea, so the Nextpnr side would be all C, the packer in Python.12:57
pepijndevosUnless using Python on Windows *at all* is problematic12:58
daveshahNo, it's more linking it that is the problem12:58
pepijndevosIMO... windows in general is just problematic -.-12:58
pepijndevosAlright, sounds good then :)12:59
pepijndevosDoes Nextpnr generally support the constraint format supported by the vendor tools, or does it have its own format? Seems ice40 uses pcf while ECP5 uses lpf, not familiar with their respective vendor tools.13:32
daveshahNormally it uses the vendor format13:32
pepijndevosI see, thanks.13:32
*** alexhw has quit IRC14:03
mwkis that something we'd like to change, btw?14:04
mwkit'd be nice to have a unified format14:04
daveshahI would always want vendor constraints as an option14:04
mwkwell, definitely14:04
daveshahIt mostly depends if maintaining two constraint formats per arch is worth it14:05
*** alexhw has joined #yosys14:05
mwkper arch?14:05
daveshahWell, each arch would have to support the generic and vendor one14:06
daveshahSome of the generic code could be common, but probably not all of it14:06
mwkhmm.14:06
mwkthings like setting timing constraints for nets isn't really that backend-dependent, is it?14:06
daveshahNo, and that is already generic in the form of the python api14:07
mwkthough I suppose I can agree on setting stuff like I/O properties14:07
daveshahIt's more IO (moreover IO config) and general chip configuration that I'm thinking of14:07
daveshahI think the long run plan might be a roughly sdc/xdc-like tcl as a generic option easier to integrate than Python14:08
mwkthere's also stuff like *sigh* ISE14:08
daveshahThis should give us a combination of a generic format and something roughly compatible with several vendor's timing formats14:08
mwkwhere some options are only settable by bitgen command line options, and not via the UCF constraint file14:08
mwkI have no idea where to even fit that14:09
*** fsasm has quit IRC14:10
*** m4ssi has joined #yosys14:19
pepijndevosWhat's the purpose of constids.inc? Is that just a list of any type of constant whatsoever? Some seem wire names, but it seems also cell types and parameters.14:30
mwkdo you know how IDs work in nextpnr?14:31
pepijndevosUh no14:31
mwkin yosys?14:31
mwkhave you have about interned strings?14:32
mwkthe general idea is that there's this big giant global (or in nextpnr's case, per-context) table of all ID strings ever used14:32
pepijndevosOh, interned strings I know hehe14:32
mwkand the IdString class is just an int that's an index into this array14:32
pepijndevosahhhhhh14:33
mwkthe constids.inc is the initial state of this table14:33
mwkwhich needs some fixed entries, because there are strings in the binary chip database14:33
mwkand they're also represented as ints in the binary14:33
pepijndevosOh, so I only need to add the ones that represent a fixed int in the chipdb, the others will be cached automatically?14:34
mwkconstids.inc is used (or emitted? I don't remember) by the script that creates the .bba file14:34
pepijndevos.bba file?14:34
mwkso that the indices are in sync between the emitter and nextpnr14:34
mwkbinary blob assembler14:35
pepijndevoslol14:35
mwkit's the (custom) tool we use to create the binary databases in nextpnr14:35
mwkit uses a few tricks so that the whole db can just be mmaped straight into memory without needing deserialization14:35
mwkso the general idea is that you have a project that reverses the FPGA, like icestorm or prjtrellis14:36
pepijndevosOkay, I guess I need to learn about the bba. I assume it's a bit more sane and portable than the way Gowin just reads the dat file into a struct?14:36
mwkyou install it14:36
mwkthen in nextpnr you have some scripts that access prjtrellis/icestorm database at nextpnr build time, and emit the .bba files14:36
mwkwhich are assembled by the bba tool into binary files14:37
mwkwhich nextpnr then mmaps, and accesses straight thru C++ classes14:37
mwkpepijndevos: it's... well, a bit saner14:37
mwkas for portability, not really14:38
mwkyou need the binary file to be built with the same endianness as nextpnr, for one14:38
daveshahAs far as I know that's the only portability issue on any reasonable OS14:38
mwkalso, with bba, you don't have one giant struct, you have a sea of structures connected by pointers14:38
mwkwhich helps the sanity aspect a lot14:38
pepijndevosOkay, so I need to write a Gowin bba script?14:39
mwk(the pointers are encoded as relative pointers in the binary, with a bit of operator overloading on the C++ side to access them easily)14:39
daveshahOf course there's no actual need to use bba at all14:39
mwkyeah, endianness is the only issue14:39
daveshahIts only convention that nextpnr arches use it14:40
mwkbut it still means the files are not portable14:40
daveshahThe text bba files are, at least14:40
mwkpepijndevos: either that, or roll your own database format14:40
daveshahAnd they are the time consuming part to generate usually14:40
mwkwell, that or hardcode everything into nextpnr C++ code14:40
mwkbut I cannot recommend that approach14:40
daveshahFrom memory that's basically what the very first nextpnr did14:41
pepijndevosWhy not? Makes it fun to reverse engineer, with as much C++ sauce as possible... oh wait it's open source.14:41
daveshahThere was a Python script that just generated a load of C++ structs14:41
daveshah*struct instances14:42
mwkhah14:42
daveshahBut it totally killed g++ trying to build it14:42
mwkwell tbh14:42
daveshahIstr memory usage of about 12GB for an iCE40 hx8k14:42
mwkbuilding the .bba file for nextpnr is also... an experience :p14:42
daveshahAt least that bit is distributable14:42
daveshahIf someone could be bothered to set up the infra for that14:43
*** fsasm has joined #yosys14:45
mwkpepijndevos: and as for output format from nextpnr14:46
mwkwell you have several options14:46
mwkwhich depend on how you want to generate bitstreams14:47
mwkthe simplest way (from nextpnr side) is: don't have one at all14:47
mwkthese days, nextpnr can dump the current design in json format, which you can read from whatever tool you use to generate bitstreams14:48
mwkparticularly convenient if it's some python script anyway14:48
pepijndevosoh, that's neat.14:49
daveshahjust use `--write`14:49
daveshahplacement and routing is represented using attributes14:49
mwkother options are: emit a bitstream directly (preferably by linking to some separate C/C++ bitstream manipulation library you wrote), or emit some text-based format14:49
*** kraiskil has quit IRC14:53
*** emeb has joined #yosys14:58
pepijndevosI'll have to see how hard it is to generate fasm and how nice the json format is, but either of those options seems fine.15:01
*** Jybz has joined #yosys15:02
pepijndevosIn createContext it seems to load the same stuff from the values argument as well as the po::variables_map vm, what's the use of each of those? They seem to duplicate the same settings.16:03
daveshahProbably better off asking micko about that one16:03
*** kraiskil has joined #yosys16:07
*** fsasm has quit IRC16:14
*** Stary has joined #yosys16:18
*** kraiskil has quit IRC16:32
*** m4ssi has quit IRC16:52
*** vidbina_ has joined #yosys17:12
*** dys has joined #yosys18:15
*** FabM_cave has quit IRC18:17
*** vidbina_ has quit IRC19:08
*** parport0 has quit IRC19:09
*** parport0 has joined #yosys19:11
*** gorbak25 has joined #yosys20:00
*** emeb_mac has joined #yosys20:49
*** adjtm has quit IRC20:54
*** adjtm has joined #yosys21:23
*** Jybz has quit IRC21:52
*** emeb has quit IRC22:59

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