Lofty changed the topic of #prjmistral to: Project Mistral: Yosys (and hopefully nextpnr) on Cyclone FPGAs - https://github.com/ZirconiumX/mistral - logs: https://freenode.irclog.whitequark.org/prjmistral
frubbl has joined #prjmistral
futarisIRCcloud has joined #prjmistral
frubbl has quit [Ping timeout: 246 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 272 seconds]
frubbl has joined #prjmistral
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
frubbl has quit [Ping timeout: 260 seconds]
frubbl has joined #prjmistral
frubbl has quit [Read error: Connection reset by peer]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 246 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 240 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 264 seconds]
Lofty has quit [Quit: Love you all~]
ZirconiumX has joined #prjmistral
jordigw has quit [Ping timeout: 240 seconds]
jordigw has joined #prjmistral
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 240 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 268 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 264 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 272 seconds]
frubbl has joined #prjmistral
frubbl has quit [Ping timeout: 240 seconds]
frubbl has joined #prjmistral
ZirconiumX is now known as Lofty
<Lofty> Sarayan: is the routing database fixed? Given all the things you've added recently I'm a little concerned about including the LZMA work
<Lofty> Eh, I merged it, have fun
frubbl has quit [Ping timeout: 256 seconds]
<Sarayan> Lofty: The routing database will not change until I add timings-related stuff in there
<Sarayan> and at that point I don't know exactly what I'll have to add
<Sarayan> I'm working on the documentation still right now :-)
<Sarayan> btw, there's supposed to be something called github pages that would allow to show the html doc online
<Sarayan> no idea how it works though
<Lofty> I can figure that out, probably
<Sarayan> through the miracle of automatic generation we now have over 100 pages of docs
<Lofty> Oh, goody
<Lofty> There is some slightly strange formatting though
<Lofty> Like, page 4 is empty
<Sarayan> pdf or html?
<Sarayan> well, html is single-page, so pdf
<Sarayan> yeah, didn't try to optimize anything on the pdf side
<Sarayan> contents first
<Sarayan> you're more than welcome to make anything better :-)
<Lofty> Since GitHub doesn't display HTML for bizarre reasons, I'm using the PDF as a reference
<Sarayan> you can firefox docs-html/index.html
<Sarayan> (that's what I do)
<Sarayan> also, fuck yeah, decompression is much faster
<Sarayan> and the files look smaal enough to be embeddable
<Sarayan> later, contents first
<Lofty> Sarayan: you're welcome :P
<Lofty> If I was feeling really fancy there's one of the very new compression libraries like brotli or zstd
<Lofty> But xz is still pretty fast
<Sarayan> asking for liblzma is probably easier that anything fancier
<Lofty> Yeah, I'm pretty sure it's Sufficiently Ubiquitous
<Lofty> In terms of absolute decompression speed, the fastest is...probably either zlib or lz[o4]
<Lofty> But I think zlib's gonna be pretty big
<Sarayan> zlib is way too big
<Sarayan> I mean the compression result
<Lofty> Mhm
<Lofty> Honestly surprised how well LZMA did on this
<Lofty> I was mostly targeting faster decompression
<Lofty> But LZMA is just straight-up smaller
<Sarayan> hmmm, I have order issues in my p2p tables
<Sarayan> of course it's the first time I dump them to check, so not surprising
Lofty has quit [Remote host closed the connection]
ZirconiumX has joined #prjmistral
ZirconiumX is now known as Lofty
<Lofty> Sarayan: I think it would be useful to have the bit value of an option, rather than just the option na,e
<Lofty> *name
<Sarayan> why?
<Lofty> https://puu.sh/H2hql/4d88b4a85a.png <-- this is a bit difficult to understand, compared to something which said "0000 = l5, 0001 = l5_ft" etc
<Lofty> And for stuff like DFT_MODE, where there are three values, is this 00/01/1x? Is the fourth value undocumented?
<Lofty> That kind of thing
<Sarayan> 00 l5 40 l5_ft 04 l5_fb 44 l5_ftb ae l6 ! 9e l6_ft ad l6_fb 9d l6_ftb a0 l7_e0 90 l7_e0_ft a4 l7_e0_fb 94 l7_e0_ftb 0e l7_e1 4e l7_e1_ft 0d l7_e1_fb 4d l7_e1_ftb
<Sarayan> these are the choices with the values, in which way does that help?
<Sarayan> what's missing is the text and schemas explaining it, the value itself means nothing
<Lofty> Except the value very much *does* mean something
<Lofty> Like, going back to DFT_MODE which you later use as an example, it turns out these aren't 2-bit but 3-bit, with 5 unknown states
<Lofty> Sarayan: can you imagine an instruction set manual that thinks the actual values of the opcodes is unimportant?
<Sarayan> Sure, I even have one
<Lofty> It's not very useful to you if you want to write an assembler, is it?
<Sarayan> But you're not writing an assembler
<Lofty> But somebody else might
<Lofty> Look at the Symbiflow project with FASM
<Sarayan> then they use the *-mux files
<Lofty> They might want to use their own assembly stuff
<Lofty> The mux files shouldn't be the only source of data
<Sarayan> that sentence makes no sense
<Sarayan> why should there be multiple base sources?
<Sarayan> that's asking for discrepencies you can't solve
<Lofty> Redundancy
<Lofty> You're already generating all this information from the mux files, anyway
<Sarayan> yeah, I'm generating cv-bmux-data.cc from them too
<Lofty> Have you seen whitequark's prjbureau docs?
<Sarayan> Nope
<Sarayan> and the extra values are more than undocumented, they're never, ever generated by quartus
<Sarayan> so if you use them, go figure what's going to happen. Short circuit is an option
<Lofty> So, yes, everybody agrees that the values do matter
<Lofty> And even if you generate them starting from the mux, I believe the bit values and locations (or, I suppose, offsets from the start of a tile) should be included in the documentation
<daveshah> http://yosyshq.net/prjtrellis-db/ECP5/tilehtml/PLC2.html - F6B3 means frame 6 bit 3 relative to the start of the tile; for example
<Sarayan> And I think that makes the documentation unreadable
<Sarayan> look at the scale of the thing
<Lofty> When you're talking about offsets from a tile, it doesn't matter if you have a GT300F or a GX25F
<Sarayan> Nope, but the -mux files are 4640 lines
<Sarayan> that is what matters
<Sarayan> these are fucking big chips
<Lofty> I wouldn't call an ECP5 small
<Sarayan> there are 1435 different muxes in the logic blocks
<Lofty> It's only unmanageable if you just dump the data at people
<Lofty> Like, prjbureau is really well done, I think
<Lofty> I dunno, is it really unreasonable to ask?
<Sarayan> I don't see how to make it work
<Sarayan> But otoh, you're more than welcome to try
<Lofty> The coordinates could also use more explaining
<Lofty> How long is a row/column?
<Sarayan> row ? 86. column ? depends
<Lofty> Because if I take
<Lofty> i lut_mask r-:64 2.5 3.5 3.4 4.4 4.5 5.5 5.4 6.4 11.4 10.4 10.5 9.5 9.4 8.4 8.5 7.5 12.5 13.5 13.4 14.4 14.5 15.5 15.4 16.4 21.4 20.4 20.5 19.5 19.4 18.4 18.5 17.5 2.7 3.7 3.6 4.6 4.7 5.7 5.6 6.6 11.6 10.6 10.7 9.7 9.6 8.6 8.7 7.7 12.7 13.7 13.6 14.6 14.7 15.7 15.6 16.6 21.6 20.6 20.7 19.7 19.6 18.6 18.7 17.7
<Lofty> And try to draw that in a table of bit locations
<Lofty> It's useful to know the "dimensions" of them
<Sarayan> oh sure
<Sarayan> one second
<Sarayan> LAB is 86x30
<Sarayan> sorry
<Sarayan> 30x86
<Sarayan> MLAB is 47x86
<Lofty> This is gonna be fun to sketch
<Sarayan> M10K is 259x86
<Sarayan> and DSP is 3x172
<Sarayan> everything else is in pram
<Sarayan> except for a smattering of bits :-)
<Lofty> Okay, next question on the list
<Lofty> A LAB has 10 ALMs, but you only list the bit positions of one LUT mask
<Lofty> Where are the other nine?
<Sarayan> magic
<Sarayan> it's the only case though
<Sarayan> mux_to_source.py::lab_expand
<Sarayan> that compues the 10 positions for every bit from what's in mux
<Lofty> Which means the canonical mux files are...not canonical?
<Lofty> Right.
<Sarayan> only lab has that
<Lofty> My point still stands ;)
<Sarayan> in part because it was the first one I did
<Sarayan> and they were derivable algorithmically
<Lofty> And, sure
<Sarayan> but the schemas for everything else are going to be a lot funnier, since they're mono-dimensional
<Lofty> We can fold them
<Lofty> By force if necessary
<Sarayan> you should, given the hip is 6304 bits
<Sarayan> and the hmc 4843
<Sarayan> but the idea of the doc, in fact, is for people who want to do stuff with the library and actually make bitstreams. Not so much a guide to the cyclone V at low level
<Lofty> It kinda fails at the goal of "documenting the Cyclone V bitstream" if it doesn't
<Lofty> Anyway
<Sarayan> it's not really the goal, unless you plan to add a printout of the 36 million routing bits too
<Sarayan> the goal is a full open-source dev pipeline
<Lofty> <Sarayan> it's not really the goal, unless you plan to add a printout of the 36 million routing bits too <-- I'm near certain this can be reduced
<Sarayan> It can, but I'm near certain you don't realize the amount of work
<Lofty> Accounting for Cromwell's rule, anyway
<Sarayan> H3 is going to drive you nuts
<Sarayan> because the patterns change when the line touches a transition or the special central column
<Lofty> As a side note, the ad hoc text format is...not the best decision ever
<Sarayan> which one?
<Lofty> The entire mux file format
<Sarayan> you realize I typed most of these by hand? Apart from hip and hmc (and even then), they're not generated?
<Sarayan> they're optimized for me and my text editor
<Sarayan> and if you say I should have written some kind of editor, I'll refer you to xkcd 1319
<Lofty> I'm not saying that at all
<Lofty> Make no mistake: I am *deeply grateful* for what you've done
<Sarayan> L-)
<Sarayan> :-)
<Lofty> And I am well aware of the effort you have put into this
<Sarayan> I'm not saying it's the end-all of the project
<Sarayan> I really want the information in usable, parseable formats, and then they can change from something better, I won't mind at all
<Lofty> But now that we have this data, I think now is a reasonable time to convert it into something which machines find easier to parse
<Sarayan> You mean C++? :-)
<Lofty> Heh
<Lofty> The Rustacean in me refuses to give you that one :P
<Sarayan> you can change the python scripts to generate rust
<Sarayan> I was serious when I was saying the idea is to allow libraries on ther languages
<Sarayan> in other
<Sarayan> or with different interfaces or whatever
<Lofty> Sure
<Sarayan> there isn't much in the C++, and that's the point
<Lofty> But I see two different interfaces here
<Sarayan> the non-generated one that is
<Lofty> There are the binary blobs in gdata
<Lofty> And there are the mux text files which $generator turns into $target_language
<Sarayan> which are a direct binary conversion of the text in chip-r.txt.bz2 (which could go 7z too fwiw)
<Sarayan> it's all text files
<Lofty> At the moment, that's a Python script generating C++
<Sarayan> the stuff in gdata would be C++ too if it was doable, but it isn't
<Sarayan> there's five of them, but sure
<Sarayan> (blocks, muxes, inverters, packages, models)
<Lofty> But equally the Python script could use `import json` instead of the ad-hoc parsers
<Sarayan> Sure, but that's something to do when all the information is extracted
<Lofty> Ah, I was under the impression it already was
<Sarayan> we're missing a lot of logic block boundary mapping, and we're missing everything timings
<Sarayan> when *that* is done we can see how to go smarter on the data encoding
<Lofty> Okay, fair
<Sarayan> you have access to rnmgr.cc, you can see how much of a mess it is, I don't want to try to generate json with it
<Sarayan> especially since there's not real point
<Lofty> Mmm
<Sarayan> I mean, we can convert the text files to nicer formats later, especially since we have the parsers :-)
<Sarayan> except for the routing files, unless you can go kolmogorov complexity any change has a fair chance of making things bigger
<Sarayan> way bigger
<Sarayan> (as in, unless you can write code that generates them from thin air)
<Lofty> <Sarayan> (as in, unless you can write code that generates them from thin air) <-- I can if I break into Intel and steal the source code /s
<Sarayan> not sure there's one
<Sarayan> long lines are kinda regular, and what's directly connecting to inner logic blocks kinda is too
<Sarayan> shorter lines, they put in hundreds per tile and it feels like they connected them wherever there was space
<Lofty> Hmmm
<Sarayan> I can be wrong, I was trying to generate the routing before I understood I had to revert the tables and generate the mux patterns
<Sarayan> Could be much simpler now
<Sarayan> but I don't want to try now because I know it's going to interact with the timings stuff (how could it not) and I don't want to trash work again
<Lofty> That's fair
<Sarayan> and there's so much stuff to do still
<Lofty> Sure
<Lofty> Perhaps we should add a version number to the blobs :P
<Sarayan> theoretically, we should generate them as part of the compilation process. Would make it slower though
<Sarayan> it's not an opaque blob in the traditional sense, it's more of an object file
<Sarayan> since we provide the text source and the "compilation" python
<Sarayan> if we had a decent compilation process instead of a hacked up makefile we could not provide them
<Sarayan> I think the next step is going to be documenting the LAB
<Sarayan> But that requires drawing, so it's sleep time now