clifford changed the topic of #yosys to: Yosys Open SYnthesis Suite: http://www.clifford.at/yosys/ -- Channel Logs: https://irclog.whitequark.org/yosys
gatin00b has joined #yosys
fsasm has quit [Ping timeout: 240 seconds]
kraiskil has joined #yosys
emeb_mac has quit [Quit: Leaving.]
emeb_mac has joined #yosys
PyroPeter has quit [Ping timeout: 276 seconds]
kraiskil has quit [Ping timeout: 265 seconds]
PyroPeter has joined #yosys
kraiskil has joined #yosys
_whitelogger has joined #yosys
Jybz has joined #yosys
citypw has joined #yosys
FabM has joined #yosys
FabM has quit [Read error: Connection reset by peer]
kraiskil has quit [Ping timeout: 240 seconds]
FabM_cave has joined #yosys
FabM_cave has quit [Read error: Connection reset by peer]
emeb_mac has quit [Quit: Leaving.]
Jybz has quit [Quit: Konversation terminated!]
citypw has quit [Ping timeout: 240 seconds]
citypw has joined #yosys
X-Scale` has joined #yosys
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
voxadam has quit [Read error: Connection reset by peer]
voxadam has joined #yosys
promach has quit [Quit: promach]
philtor has quit [Ping timeout: 268 seconds]
FabM has joined #yosys
FabM is now known as FabM_vace
FabM_vace is now known as FabM_cave
X-Scale has quit [Ping timeout: 265 seconds]
X-Scale` has joined #yosys
X-Scale` is now known as X-Scale
kraiskil has joined #yosys
citypw has quit [Ping timeout: 240 seconds]
kraiskil has quit [Ping timeout: 240 seconds]
fsasm has joined #yosys
kraiskil has joined #yosys
Stary has quit [Ping timeout: 264 seconds]
X-Scale has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Nine out of ten l33t h4x0rz prefer it]
X-Scale has joined #yosys
<pepijndevos> What's the discerning factor for getting a plugin into yosys-plugins or yosys proper?
<daveshah> I don't think yosys-plugins has much in the way of criterea
<daveshah> yosys itself would depend more on quality, dependencies, and portability
<daveshah> One option for features like the protobuf backend and python api is to have them in Yosys but disabled by default in the makefile
<daveshah> If they add unnecessary dependencies
<pepijndevos> Right, like verific
<daveshah> Yeah
<pepijndevos> I'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"
<daveshah> No, asc files are a horrible format
<daveshah> I would personally use fasm for any new architecture
<tpb> Title: GitHub - SymbiFlow/fasm: FPGA Assembly (FASM) Parser and Generator (at github.com)
<daveshah> (in many ways I don't love it, but it is a standard at least)
<pepijndevos> Ohhhh fancy
<pepijndevos> Sounds reasonable
<pepijndevos> I 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?
<daveshah> It's used for the Python API
<daveshah> But you can turn that off in the build if you don't want it complicating things
<pepijndevos> I 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?
<daveshah> No nothing in the actual flow uses the Python API
<daveshah> it'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)
<pepijndevos> Hmmm, 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.
<daveshah> Please don't
<pepijndevos> Which part?
<daveshah> The Python API is somewhat by necessity a pain to build on certain platforms (windows)
<daveshah> as a result many of the static builds prefer to exclude the python api
<daveshah> a few weeks ago I added a way to specify timing constraints without python for this very reason
<daveshah> Oh wait, you mean C printf
<daveshah> I thought you meant write parts of the nextpnr flow in Python
<pepijndevos> Yea, so the Nextpnr side would be all C, the packer in Python.
<pepijndevos> Unless using Python on Windows *at all* is problematic
<daveshah> No, it's more linking it that is the problem
<pepijndevos> IMO... windows in general is just problematic -.-
<pepijndevos> Alright, sounds good then :)
<pepijndevos> Does 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.
<daveshah> Normally it uses the vendor format
<pepijndevos> I see, thanks.
alexhw has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<mwk> is that something we'd like to change, btw?
<mwk> it'd be nice to have a unified format
<daveshah> I would always want vendor constraints as an option
<mwk> well, definitely
<daveshah> It mostly depends if maintaining two constraint formats per arch is worth it
alexhw has joined #yosys
<mwk> per arch?
<daveshah> Well, each arch would have to support the generic and vendor one
<daveshah> Some of the generic code could be common, but probably not all of it
<mwk> hmm.
<mwk> things like setting timing constraints for nets isn't really that backend-dependent, is it?
<daveshah> No, and that is already generic in the form of the python api
<mwk> though I suppose I can agree on setting stuff like I/O properties
<daveshah> It's more IO (moreover IO config) and general chip configuration that I'm thinking of
<daveshah> I think the long run plan might be a roughly sdc/xdc-like tcl as a generic option easier to integrate than Python
<mwk> there's also stuff like *sigh* ISE
<daveshah> This should give us a combination of a generic format and something roughly compatible with several vendor's timing formats
<mwk> where some options are only settable by bitgen command line options, and not via the UCF constraint file
<mwk> I have no idea where to even fit that
fsasm has quit [Quit: Leaving]
m4ssi has joined #yosys
<pepijndevos> What'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.
<mwk> do you know how IDs work in nextpnr?
<pepijndevos> Uh no
<mwk> in yosys?
<mwk> have you have about interned strings?
<mwk> the general idea is that there's this big giant global (or in nextpnr's case, per-context) table of all ID strings ever used
<pepijndevos> Oh, interned strings I know hehe
<mwk> and the IdString class is just an int that's an index into this array
<pepijndevos> ahhhhhh
<mwk> the constids.inc is the initial state of this table
<mwk> which needs some fixed entries, because there are strings in the binary chip database
<mwk> and they're also represented as ints in the binary
<pepijndevos> Oh, so I only need to add the ones that represent a fixed int in the chipdb, the others will be cached automatically?
<mwk> constids.inc is used (or emitted? I don't remember) by the script that creates the .bba file
<pepijndevos> .bba file?
<mwk> so that the indices are in sync between the emitter and nextpnr
<mwk> binary blob assembler
<pepijndevos> lol
<mwk> it's the (custom) tool we use to create the binary databases in nextpnr
<mwk> it uses a few tricks so that the whole db can just be mmaped straight into memory without needing deserialization
<mwk> so the general idea is that you have a project that reverses the FPGA, like icestorm or prjtrellis
<pepijndevos> Okay, 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?
<mwk> you install it
<mwk> then in nextpnr you have some scripts that access prjtrellis/icestorm database at nextpnr build time, and emit the .bba files
<mwk> which are assembled by the bba tool into binary files
<mwk> which nextpnr then mmaps, and accesses straight thru C++ classes
<mwk> pepijndevos: it's... well, a bit saner
<mwk> as for portability, not really
<mwk> you need the binary file to be built with the same endianness as nextpnr, for one
<daveshah> As far as I know that's the only portability issue on any reasonable OS
<mwk> also, with bba, you don't have one giant struct, you have a sea of structures connected by pointers
<mwk> which helps the sanity aspect a lot
<pepijndevos> Okay, so I need to write a Gowin bba script?
<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)
<daveshah> Of course there's no actual need to use bba at all
<mwk> yeah, endianness is the only issue
<daveshah> Its only convention that nextpnr arches use it
<mwk> but it still means the files are not portable
<daveshah> The text bba files are, at least
<mwk> pepijndevos: either that, or roll your own database format
<daveshah> And they are the time consuming part to generate usually
<mwk> well, that or hardcode everything into nextpnr C++ code
<mwk> but I cannot recommend that approach
<daveshah> From memory that's basically what the very first nextpnr did
<pepijndevos> Why not? Makes it fun to reverse engineer, with as much C++ sauce as possible... oh wait it's open source.
<daveshah> There was a Python script that just generated a load of C++ structs
<daveshah> *struct instances
<mwk> hah
<daveshah> But it totally killed g++ trying to build it
<mwk> well tbh
<daveshah> Istr memory usage of about 12GB for an iCE40 hx8k
<mwk> building the .bba file for nextpnr is also... an experience :p
<daveshah> At least that bit is distributable
<daveshah> If someone could be bothered to set up the infra for that
fsasm has joined #yosys
<mwk> pepijndevos: and as for output format from nextpnr
<mwk> well you have several options
<mwk> which depend on how you want to generate bitstreams
<mwk> the simplest way (from nextpnr side) is: don't have one at all
<mwk> these days, nextpnr can dump the current design in json format, which you can read from whatever tool you use to generate bitstreams
<mwk> particularly convenient if it's some python script anyway
<pepijndevos> oh, that's neat.
<daveshah> just use `--write`
<daveshah> placement and routing is represented using attributes
<mwk> other options are: emit a bitstream directly (preferably by linking to some separate C/C++ bitstream manipulation library you wrote), or emit some text-based format
kraiskil has quit [Ping timeout: 240 seconds]
emeb has joined #yosys
<pepijndevos> I'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.
Jybz has joined #yosys
<pepijndevos> In 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.
<daveshah> Probably better off asking micko about that one
kraiskil has joined #yosys
fsasm has quit [Quit: Leaving]
Stary has joined #yosys
kraiskil has quit [Ping timeout: 265 seconds]
m4ssi has quit [Remote host closed the connection]
vidbina_ has joined #yosys
dys has joined #yosys
FabM_cave has quit [Quit: Leaving]
vidbina_ has quit [Ping timeout: 276 seconds]
parport0 has quit [Ping timeout: 245 seconds]
parport0 has joined #yosys
gorbak25 has joined #yosys
emeb_mac has joined #yosys
adjtm has quit [Remote host closed the connection]
adjtm has joined #yosys
Jybz has quit [Quit: Konversation terminated!]
emeb has quit [Quit: Leaving.]
tpb has quit [Remote host closed the connection]
tpb has joined #yosys