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
pepijndevos has quit [Ping timeout: 246 seconds]
pepijndevos has joined #prjmistral
* Sarayan waves
phire has quit [*.net *.split]
phire has joined #prjmistral
<Sarayan> Lofty: uncheckable guesswork in timings is worse than no timings
<Lofty> Sarayan: well, by definition they're checkable
<Lofty> Anyway, I have an idea for you
<Lofty> If you look at quartus/common/devxml there's a bunch of encrypted files, (which I'm assuming *are* XML)
<Lofty> And we know that Quartus uses VPR and that VPR uses XML database format
<Lofty> If you could hunt for an encryption key maybe we could find something from them
<Lofty> Experimentally renaming some files/folders in there shows that it's definitely part of the VPR section
<Lofty> ping Sarayan
<Sarayan> pong
<Sarayan> what's vpr?
<Lofty> Versatile Place and Route
<Sarayan> oh
<Lofty> Which is 20 years old, and I'll just state there's a good reason we're not using it
<Sarayan> so you say quartus_fit uses it?
<Lofty> I *know* quartus_fit uses it :P
<Sarayan> well, you says quartus_fit uses the files in devxml.cag.cyclonev ?
<Sarayan> -s
<Lofty> And devxml/b2b/cyclonev
<Lofty> cag is CDB_ATOM_GENERIC
<Sarayan> ah cute
<Sarayan> ok, let's break that format open
<Lofty> And if you rename folders/files you can trip internal errors that give you a bit of insight into what's there
<Lofty> Internal Error: Sub-system: B2B, File: /quartus/db/b2b/b2b_block_idspace.cpp, Line: 1111
<Lofty> Could not get block for la_lab (key: cyclonev/la_lab)
<Lofty> I think b2b is the folder to look at
<Lofty> cag/cyclonev/ contains some small stuff
<Lofty> But b2b/cyclonev/ contains a lot of goodies
<Lofty> cc is clock mux I think
<Lofty> ds is DSP
<Lofty> hd is transceivers I think
<Lofty> hi is...something
<Lofty> hm is hard memory controller, with hp for its PHY
<Sarayan> hip = hip?
<Sarayan> hi = hip?
<Lofty> im looks LVDS related
<Sarayan> aka pcie
<Lofty> It could be PCIe.
<Lofty> io is...I/O and I *think* ir is I/O registers
<Lofty> la is LAB and friends
<Lofty> mm is M10K memory
<Lofty> pl is fracturable PLLs
<Lofty> pm is Physical Medium Attachment; gatecat thinks it's the PHY for hd
<Sarayan> fractional, not fracturable :-)
<Lofty> Fragible :P
<Lofty> *frangible
<Lofty> So yeah, I think there are a lot of goodies in there.
<Sarayan> FPLL means the M divider can have a non-integer (fractional) value
<Lofty> Another thing, in case you missed it, is that there's an undocumented option called compute_slack
<Lofty> But it ICEs for me
<Lofty> *an undocumented option for quartus_fit
<Lofty> And an undocumented TCL module called ::quartus::legacy_fitter
<Lofty> (which is what the V series uses)
<Lofty> So how'd I do for research? :P
<Sarayan> Useful :-)
<Lofty> gatecat: do you know if VPR's XML databases store timings?
<gatecat> yeah they do
<Lofty> Potentially promising then :P
<gatecat> yeah :)
<Sarayan> hmmm, so it uses QTL_ZIFSTREAM::open
<Lofty> So yeah, if we already have the bitstream keys to the castle, one would hope that breaking the VPR databases gives us the timing keys
<Lofty> Z as in...compressed?
<Sarayan> yes
<Sarayan> possibly AES-encrypted too
<Sarayan> tracing the open of devxml/b2b/cyclonev/la/_l_ale.xml right now
<Sarayan> It matches QTL_ZSTREAM::CE_HEADER_V1 (ac ef 01 00 00 00 00 00) which I think means compressed and encrypted
<Lofty> Yep
<Sarayan> a2 9d 1e 38 ca 8c 7f 41 e3 3e 4c 09 5c 23 3a d3
<Lofty> Gesundheit.
<Sarayan> I will deny that being the aes key used to decrypt everything in quartus lite 18.1
<Lofty> I wonder if it's still not applicable to 19.1
<gatecat> :nya_a:
<Sarayan> devxml/b2b/cyclonev/la/_l_ale.xml starts with 00000000: acef 0100 0000 0000 50a8 7f55 5533 2874 ........P..UU3(t
<Sarayan> in 18.1
<Sarayan> what about yours?
<Lofty> 00000000: acef 0100 0000 0000 50a8 7f55 5533 2874 ........P..UU3(t
<Sarayan> Definitely not applicable then
<Lofty> What a shame.
<Sarayan> since it's not applicable to 18.1
<Sarayan> also, apropos of nothing and if you're bored, you can do a nm libccl_xml.so | fgrep _ZL15xml_basics_of_e
<Sarayan> which gives you an address
<Lofty> Now I need to find a command line AES decoder so I can fail to decrypt the Quartus XML files
<Sarayan> then do an objdump -s libccl_xml.so and look at that address
<Sarayan> I'm sure there's some python that can do it and do the unpacking after
Sarayan has quit [Remote host closed the connection]
<Lofty> Ah, the copyright police got to Sarayan already?
<Lofty> Unfortunate.
<gatecat> you wouldn't steal a..... AES key
<Lofty> gatecat: the funniest bit of that is that it's an anti-piracy video with no license for the music, so it's pirating the music, and that's why it disappeared suddenly
<gatecat> hahahaha
<gatecat> I hadn't heard that part of the story before
Sarayan has joined #prjmistral
<Sarayan> re
<Sarayan> ECB, no chaining
<Sarayan> og.kervella.org/xmldec.py
<Sarayan> Damn, they're all dead ;-)
<Sarayan> In the same vein, quartus pro is not at all using the exact same format and encryption key, of course not, no siree
<Lofty> Hi Sarayan
<Lofty> I'm alive
<Sarayan> Good :-)
<Lofty> For real though, there's no timing information in these as far as I can see
<Lofty> Descriptions, but no timing data
<Lofty> Which is a touch frustrating
<Lofty> Sarayan: have you checked the .sin files?
<Sarayan> dmf has precalculated in-block timings, fdi has a combination of rc and actual timings, model has in-depth description of the inner of blocks with r/c and friends
<Sarayan> sin files are pile-of-numbers iirc
<Lofty> Hmm, okay
<Sarayan> there's rough block-block delays used by synthesis, things to do with mtbf and some "aiot" stuff I'm not sure what it is
<Lofty> MTBF analysis is used for checking clock crossing stability
<Lofty> So that's why you're looking at fdi?
<Sarayan> fdi has the routing delays and the routing rcs
<Sarayan> so it's reather necessary
<Sarayan> rather
<Lofty> Mhm
<Sarayan> I *think* fit uses the delays and sta the rcs
<Sarayan> I'm going to keep hitting on the fdi, if you find information in the xml or anywhere else that allows to validate/complete the block schematics it would be cool
<Lofty> gatecat: which do you think we should use, given that nextpnr basically *is* the STA tool
<Lofty> Sarayan: as for the XMLs, I think they at least make good reference points for diagrams
<Sarayan> nextpnr is the fit tool too :-)
<Lofty> It is, but I think we'll do better if we have the more accurate timings in nextpnr
<Lofty> It's not like we're gonna be slower than Quartus ;)
<Lofty> If there was a magic signoff tool then we could consider giving nextpnr something faster
<Lofty> But right now I think RC delay is the primary objective
<Sarayan> this morning you were saying it wasn't :-)
<gatecat> yeah RC delays are ideal
<Lofty> These things are complicated ^^;
<gatecat> we can always use a simpler RC model for routing than for signoff
<gatecat> I might need to add support for something like that for the interchange stuff anyway, depending on how it goes
<gatecat> Sarayan: personally I never said RC delays weren't what we wanted, BTW, it was full SPICE models that would be too slow
<gatecat> RC values are definitely not the same as SPICE models and certainly won't involve any kind of full circuit simulation
<gatecat> basically the way the model works is just adding and multiplying things to determine time constants
<Sarayan> not at all sure how spicy their spice is
<Sarayan> og.kervella.org/quartus.ini gives you an amusing amount of debug dumps when running sta
<gatecat> the big question is whether anything is actually modelling transistors, or just RC delays
<Sarayan> Can't tell yet
<gatecat> trying that ini the only thing I can see that looks like a spice netlist is for IO timing (which nextpnr doesn't really do much with yet in any event)
etrig has quit [Quit: leaving]
<Sarayan> which file do you identify as a spice netlist?
<gatecat> the jsp files, created for each output pin
<Sarayan> thanks
lethalbit has quit [Ping timeout: 240 seconds]
lethalbit has joined #prjmistral