Friday, 2021-07-16

*** tpb <[email protected]> has joined #yosys00:00
*** gsmecher <[email protected]> has quit IRC (Ping timeout: 252 seconds)00:25
*** kaji <kaji!~kajiryoji@2001:470:69fc:105::405b> has quit IRC (Quit: Reconnecting)00:36
*** kaji <kaji!~kajiryoji@2001:470:69fc:105::405b> has joined #yosys00:36
*** kaji <kaji!~kajiryoji@2001:470:69fc:105::405b> has quit IRC (Client Quit)00:36
*** kaji <kaji!~kajiryoji@2001:470:69fc:105::405b> has joined #yosys00:37
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has quit IRC (Ping timeout: 255 seconds)01:20
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys01:21
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has quit IRC (Ping timeout: 255 seconds)01:35
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys01:36
*** ecs <ecs!ecs@sourcehut/interns/ecs> has joined #yosys05:02
*** FabM <FabM!~FabM@armadeus/team/FabM> has joined #yosys05:21
*** diadatp is now known as diadatp_irccloud07:09
*** diadatp <diadatp!~diadatp@user/diadatp> has joined #yosys07:10
*** diadatp <diadatp!~diadatp@user/diadatp> has quit IRC (Client Quit)07:12
*** diadatp_irccloud <[email protected]> has quit IRC ()07:12
*** diadatp <diadatp!uid508601@user/diadatp> has joined #yosys07:12
*** vidbina <[email protected]> has joined #yosys09:17
Sarayanwhitequark: just tried top-of-tree on m68k.v, it's not entirely working but it's close.  I'll try to find out what's going on (looks like it's trying to do a memory read, which is good, but never sets as/uds/lds)11:13
whitequarkoh sweet!11:13
whitequarkdid you ever get it working before? (is this a regression?)11:13
SarayanNo11:13
Sarayanit's a progression :-)11:13
whitequarktry using `write_cxxrtl -nohierarchy`11:14
Sarayanthere was the issue with the array of clocks, dunno if the PR has been taken into account (not a PR by me)11:14
whitequarkit has been11:14
Sarayancool11:15
Sarayancompiling lalala11:15
Sarayan(it generates a *big* c++ file :-)11:15
whitequarksure does11:15
SarayanI'm always amused at having to raise the bracket-depth11:16
Sarayanno visible change11:16
whitequarkah, so not that then11:16
whitequarkplease let me know what the issue is!11:16
Sarayanyeah, when I find it :-)11:17
Sarayanbut I shall11:17
*** mewt <[email protected]> has quit IRC (Read error: Connection reset by peer)11:18
Sarayanfunnily enough, a lot more stuff happens when you actually raise (disable) the HALTn pin12:13
Sarayanthere's a fair chance the 68k actually works12:13
whitequarkoooh12:16
SarayanI wouldn't have guessed that the halt pin halted on the next memory access12:16
Sarayanand not immediately12:16
Sarayanthe 68k does 5 micro-ops at reset before starting to read the vectors12:16
Sarayanok, not only the 68k is working, but it's executing a stream of nops at roughly 200KHz on my laptop12:49
whitequarkis that good?12:50
Sarayanwell, you tell me, but for that level of emulation I suspect it is12:51
Sarayan1/400th of real time for a typical 8MHz 68k12:51
Sarayan1/40th of real time for a typical 8MHz 68k12:51
Sarayanstop the zero inflation :-)12:51
whitequarkseems like there are feedback arcs12:52
Sarayanyeah12:52
Sarayanplan to do a nmigen version at some point.  Didn't write that one12:52
SarayanJust want to be able to bisimulate with a know good low-level core12:53
whitequarkrun `-p 'hierarchy -auto-top; proc; flatten; splitnets -driver; clean -purge; splitnets -driver; clean -purge' -b cxxrtl`12:54
Sarayanokay12:54
* Sarayan adds the black magic12:54
SarayanI put that as a yosys command between hierarchy and write_cxxrtl?12:55
whitequarkcan you show me your current script?12:55
Sarayanoh, I see, it's a series of commands in fact12:55
whitequarkI'll adjust it12:55
Sarayanyosys <<EOF12:55
Sarayanread -vlog95 m68k.v12:55
Sarayanhierarchy -top fx68k12:55
Sarayanwrite_cxxrtl m68k.cc12:55
SarayanEOF12:55
whitequarkthat'd be simpler12:55
whitequarkhttps://paste.debian.net/1204568/12:56
tpbTitle: debian Pastezone (at paste.debian.net)12:56
Sarayancompiling12:57
Sarayancrashed...12:57
whitequarkhm, crashed?12:57
Sarayanmain.cc:79:8: error: no member named 'p_microAddr' in 'cxxrtl_design::p_fx68k'12:57
Sarayan         m68k.p_microAddr.get<uint32_t>());12:57
Sarayan         ~~~~ ^12:57
Sarayanmain.cc:105:8: error: invalid argument type 'wire<1>' to unary expression12:57
Sarayan    if(!m68k.p_ASn) {12:57
Sarayan       ^~~~~~~~~~~12:57
Sarayanmain.cc:123:8: error: value of type 'wire<1>' is not contextually convertible to 'bool'12:57
Sarayan    if(m68k.p_ASn) {12:57
Sarayan       ^~~~~~~~~~12:57
whitequarkohh12:57
Sarayanhmmm, miroaddr is debug stuff I read, I can remove it12:58
whitequarkand for the others use .get<bool>()12:58
Sarayanrunning...12:59
Sarayantwice faster, 400KHz13:00
whitequarkyep13:00
whitequarkshould be able to get to 600 KHz at least but this requires some ideas i have in development13:00
Sarayanvery nice13:00
Sarayanyou want me to package that code for benching?13:01
whitequarksure why not13:01
SarayanI'll do that13:02
whitequarkthank you ^^13:03
*** Max-P5 <Max-P5!~Max-P@thelounge/maintainer/Max-P> has joined #yosys13:11
*** Lord_Nightmare2 <Lord_Nightmare2!Lord_Night@user/lord-nightmare/x-3657113> has joined #yosys13:12
*** lkcl- <[email protected]> has joined #yosys13:13
*** Lord_Nightmare <Lord_Nightmare!Lord_Night@user/lord-nightmare/x-3657113> has quit IRC (*.net *.split)13:18
*** Max-P <Max-P!~Max-P@thelounge/maintainer/Max-P> has quit IRC (*.net *.split)13:18
*** kbeckmann <[email protected]> has quit IRC (*.net *.split)13:18
*** TFKyle <[email protected]> has quit IRC (*.net *.split)13:18
*** lkcl <[email protected]> has quit IRC (*.net *.split)13:18
*** philtor <[email protected]> has quit IRC (*.net *.split)13:18
*** Lord_Nightmare2 is now known as Lord_Nightmare13:18
*** Max-P5 is now known as Max-P13:18
*** TFKyle <[email protected]> has joined #yosys13:19
*** kbeckmann <[email protected]> has joined #yosys13:22
*** philtor <[email protected]> has joined #yosys13:26
Sarayanwhitequark: https://og.kervella.org/fx68k-bench.zip13:29
*** vidbina <[email protected]> has quit IRC (Ping timeout: 252 seconds)13:30
whitequarkyou can use `-I$(yosys-config --datdir/include)` to make it not dependent on your $HOME13:31
whitequark(not an issue, just something you might find useful)13:31
whitequarkand the conventional extension for yosys scripts is `.ys`13:31
Sarayan /usr/local/share/yosys/include13:31
Sarayannope13:31
Sarayannot picking the correct one13:31
whitequarkhmm how'd you install yosys?13:31
Sarayanprobably a compile issue, installed with make install PREFIX=/people/galibert13:32
SarayanI should have used PREFIX at compile? config? time too?13:32
*** vidbina <[email protected]> has joined #yosys13:34
whitequark~430 kHz here13:41
Sarayannice13:44
whitequark2.73 IPC according to `perf stat`13:47
Sarayannot bad13:47
Sarayannot bad at all13:47
Sarayanok, after recompiling yosys with PREFIX= all the time, --datdir is correct13:48
SarayanJust fyi fx68k itself is gpl, I've put the exact commit/ref at the start of m68k.v.  My code is whatever you need it to be13:50
whitequarkfor comparison, minerva runs at ~2 MHz and has 2.61 IPC13:50
Sarayanwhat's minerva?13:50
whitequarkhttps://github.com/lambdaconcept/minerva13:51
whitequarkRISC-V CPU13:51
Sarayanahhhh ok13:51
Sarayanthe 68000 has never been designed to be good in a fpga-similar setup :-)13:52
whitequarklemme look at the m68k disassembly13:52
whitequark(yes, i can actually get useful insight from looking at disassembly of C++ templates stacked dozens of levels deep)13:53
Sarayanyeah, but you're special :-P13:54
Sarayanmore seriously, I'm not even surprised.  The point of the template is to have as little code generated as possible in the first place13:54
Sarayanhandholding the compiler in a way13:54
whitequarkstrangely, no13:55
Sarayanno?13:55
whitequarkthe way CXXRTL is designed it actually expects the C++ compiler to be very clever13:55
SarayanIt's often to point of my templates, but heh13:55
whitequarklike, CXXRTL doesn't really work well without really aggressive loop unrolling and constant propagation13:55
Sarayanahhh hok I see what you mean13:56
SarayanI consider that basic, today.  It's telling the compiler that "here, that's a constant" that is important13:56
Sarayanwe don't have automatic method duplication on various possible values of a variable yet, except for some special cases like memcpy13:57
whitequarkyeah, i see what you mean13:59
whitequarkthat's one way to look at it13:59
Sarayananyway, *very* *very* happy to have fx68k run under cxxrtl14:01
whitequarkthe silliest part is that you didn't need to wait since january14:02
whitequarkcould have just lowered the debug level a bit14:02
SarayanI wasn't waiting, I was doing a thousand other things :-)14:02
whitequarkbut no one told you that in the issue, it seems14:02
whitequarkahh okay14:02
Sarayanit's you closing the issue that pushed me into testing14:03
Sarayanin fact you put something back on my todo list, so technically I should hate you ;-)14:03
Sarayanbeen mapping the m10k tiles on the cyclone v lately, which makes we wonder how one handles specialized blocks like that in nmigen/yosys/nextpnr14:05
Sarayanand in cxxrtl for the matter14:05
whitequarknmigen has Instance, yosys has black boxes, nextpnr knows how to interpret these black boxes14:06
whitequarkin cxxrtl you can load the simulation model of the black box14:06
Sarayannice14:07
Sarayanlots of plumbing on the horizon, but very nice to see all the pieces are there14:07
tntwhitequark: can cxxrtl use the cells_sim.v ?14:08
tntor do you need to write custom models ?14:08
loftySarayan: Yosys handles them as MISTRAL_M10K blocks, which nextpnr would then put in the correct BELs14:09
whitequarktnt: it really depends on the cell14:09
whitequarkbut generally, yes14:09
whitequarkiirc, i've simulated post-synthesis netlists?14:09
whitequarkactually let me just do that right now14:09
Sarayanlofty: does yosys correctly handle the quartus verilog constructs for them?14:10
loftyYes14:10
Sarayannice14:10
loftyThey get inferred from Verilog14:10
loftyThe models are...maybe a bit trickier, because the Quartus boxes are hell, but14:11
Sarayanannoyingly, an altsyncram may map to multiple m10k14:11
Sarayanso there probably will need to be some layer of "synthesys" at the yosys level if you want to cope with quartus-acceptable constructs14:12
loftyFortunately, I won't.14:13
loftyI took a long hard look in the mirror14:13
loftyAnd genuinely: fuck the Quartus boxes14:13
Sarayanmwahahahaha14:13
Sarayanyou should put that on a t-shirt, or a mug14:13
cr1901Sarayan: Yes, always pass PREFIX to make when building yosys14:17
*** mewt <[email protected]> has joined #yosys14:18
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has quit IRC (Quit: WeeChat 2.3)14:38
*** piegames <[email protected]> has quit IRC (Quit: WeeChat 3.1)15:08
Sarayanwhen it runs in 400KHz mode, can I get the internal signals still by calling something specific?15:17
whitequarkyes15:20
whitequarkyou can use the debug info15:21
whitequarkdo you know how?15:21
SarayanNot yet15:21
Sarayan(Insert upload sequence and me going I know kung fu.... wrong tape)15:22
whitequarkSarayan: https://tomverbeure.github.io/2020/08/08/CXXRTL-the-New-Yosys-Simulation-Backend.html#design-introspection15:24
tpbTitle: CXXRTL, a Yosys Simulation Backend | Electronics etc… (at tomverbeure.github.io)15:24
SarayanIs -Og implicit at this point?15:26
whitequarkit's gone15:26
whitequarkyou get all the visibility and all the optimization15:26
Sarayanbeautiful15:26
Sarayanso I can keep using p_thing for the external interface of the top module, but it's considered a good idea to go through the debug items for what's internal?15:28
whitequarkcan you keep using p_thing for the ports: yes15:28
Sarayan(I noticed I can get the "uRom microAddr" variable as p_uRom_2e_microAddr)15:28
whitequarkyou can just use p_uRom_2e_microAddr if you want15:29
whitequarkit's purely a matter of your convenience in this case15:29
Sarayan_2e_ is '.' in fact, right?15:29
whitequarkother than for ports, CXXRTL does not guarantee that the signals will be exposed as members, and if they do, what name the member will have15:29
whitequarkyes15:29
SarayanmicroAddr being a port of the uRom submodule that's why it's visible?  or it's just pure luck?15:30
whitequarkmost likely, the net you're looking at has many HDL names15:31
whitequarkon many levels of hierarchy, and possibly within a single module, too15:31
whitequarkonly one of these names ends up as the name of the class member15:31
whitequarkand it's kind of arbitrary now15:31
Sarayancute15:31
whitequarkthe debug info has all of the names15:32
Sarayangot it grepping the .cc, as one does15:32
whitequarkand they alias a single physical wire<> or value<>15:32
whitequarkthat's what it is: a precise mapping from HDL level names to the physical storage15:32
Sarayanand I get the list through debug_items(items).  Surprised you didn't use RVO15:35
whitequarklook at the implementation15:35
whitequarkconsider also that for hierarchical designs (perhaps with blackboxes) you'd have a tree of debug_items functions in the model15:36
Sarayanok, if you have a tree, ok15:36
Sarayanotherwise it would just have been debug_items items; at the start and return items; at the end15:37
SarayanI use RVO a lot, it's so natural code-wise15:37
whitequarksure15:38
Sarayanah, one can't copy debug_item around15:39
whitequarkoh, that's unintentional15:40
Sarayanoh cool.  it would be nice to make it possible to have global/member ones, which you init at start and use whenever15:41
whitequarkit's POD15:41
Sarayanno default constructor though15:41
Sarayanreferences are POD?15:42
whitequarkhm?15:42
whitequarktake a look at its definition15:42
whitequarkit's a bit weird15:42
whitequarkbecause it inherits all the fields from the struct in the C API, just adds a few methods15:42
Sarayanoh, it's not reference, it's inheritance15:43
Sarayanso the only issue is the lack of default constructor I guess15:44
whitequarkwell15:44
whitequarkit doesn't have a default state15:44
whitequarkarguably a design defect, there should've been CXXRTL_INVALID in the type enum or something15:44
Sarayanthat means you must have pointers and ensure the lifetime of the items structure you passed debug_items15:45
Sarayanthat's unfortunate15:45
whitequarkyeah15:45
whitequarkyou could also cast it to the base class and use that directly15:46
whitequarkthat's definitely default-constructible15:46
Sarayancast to a reference to cxxrtl_object before assigning?15:47
whitequarkyeah15:47
Sarayannote that if cxxrtl_object is default-constructible debug_item has no reason not to be, since it has no extra fields15:48
whitequarkwell15:48
whitequarkcxxrtl_object cannot not be default-constructible because it's a C struct15:48
whitequarkbut semantically it still doesn't have a default state15:49
Sarayanbut it shouldn't be decause it doesn't have a default state?15:49
Sarayanyeah15:49
Sarayandamned it you do, damned it you don't15:49
whitequarkit's an oversight15:49
Sarayanwell, knowing you it'll be fixed at some point :-)15:49
whitequarkthe "right" approach is perhaps to break the ABI and define CXXRTL_INVALID = 015:49
whitequarksigh. yes15:49
whitequarkyou're not wrong15:49
*** vidbina <[email protected]> has quit IRC (Ping timeout: 240 seconds)15:50
*** gsmecher <[email protected]> has joined #yosys15:50
Sarayanno get<> in debug_item?15:50
whitequarkdebug_item itself doesn't really have anything user-facing added to it15:51
whitequarkget<> and set<> would absolutely be handy15:51
Sarayanyeah, if you have a C++ wrapper make it cool :-)15:51
whitequarkplease file an issue15:52
Sarayansure15:52
*** lexano <lexano!~lexano@2607:fea8:5bc0:12:12c3:7bff:fe95:9fc1> has quit IRC (Remote host closed the connection)16:02
Sarayanadded two issues16:04
Sarayan(default-init and get<>/set<>)16:06
Sarayanyep, managed to read the microAddr through the debug_item, nice16:07
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Quit: Leaving)16:08
whitequark\o/16:17
*** Klotz <Klotz!~Klotzoman@gateway/tor-sasl/klotz> has joined #yosys16:37
*** lexano <lexano!~lexano@2607:fea8:5bc0:12:12c3:7bff:fe95:9fc1> has joined #yosys16:41
*** kristianpaul <[email protected]> has joined #yosys16:51
*** Kamilion <Kamilion!~kvirc@user/kamilion> has quit IRC (Ping timeout: 252 seconds)17:10
*** Armleo <[email protected]> has joined #yosys17:16
*** Armleo <[email protected]> has quit IRC (Ping timeout: 246 seconds)17:27
*** Kamilion <Kamilion!~kvirc@user/kamilion> has joined #yosys17:55
*** Klotz <Klotz!~Klotzoman@gateway/tor-sasl/klotz> has quit IRC (Quit: Klotz)18:14
*** vidbina <[email protected]> has joined #yosys18:18
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has quit IRC (Quit: WeeChat 2.3)19:31
*** kristianpaul <[email protected]> has joined #yosys19:36
*** vidbina <[email protected]> has quit IRC (Ping timeout: 255 seconds)20:05
*** Guest4 <[email protected]> has joined #yosys20:15
*** Guest4 <[email protected]> has quit IRC (Client Quit)20:18
*** RaitoBezarius <RaitoBezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #yosys20:42
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (Ping timeout: 240 seconds)20:42
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #yosys20:45
*** RaitoBezarius <RaitoBezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (Ping timeout: 255 seconds)20:47
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (Client Quit)20:47
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #yosys20:47
*** gsmecher <[email protected]> has quit IRC (Ping timeout: 268 seconds)23:07

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!