ChanServ changed the topic of #yosys to: Yosys Open SYnthesis Suite: https://github.com/YosysHQ/yosys/ | Channel logs: https://libera.irclog.whitequark.org/yosys/
tpb has quit [Remote host closed the connection]
tpb has joined #yosys
gsmecher has quit [Ping timeout: 252 seconds]
kaji has quit [Quit: Reconnecting]
kaji has joined #yosys
kaji has quit [Client Quit]
kaji has joined #yosys
GenTooMan has quit [Ping timeout: 255 seconds]
GenTooMan has joined #yosys
GenTooMan has quit [Ping timeout: 255 seconds]
GenTooMan has joined #yosys
ecs has joined #yosys
FabM has joined #yosys
diadatp is now known as diadatp_irccloud
diadatp has joined #yosys
diadatp has quit [Client Quit]
diadatp_irccloud has quit []
diadatp has joined #yosys
vidbina has joined #yosys
<Sarayan> whitequark: 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)
<whitequark> oh sweet!
<whitequark> did you ever get it working before? (is this a regression?)
<Sarayan> No
<Sarayan> it's a progression :-)
<whitequark> try using `write_cxxrtl -nohierarchy`
<Sarayan> there was the issue with the array of clocks, dunno if the PR has been taken into account (not a PR by me)
<whitequark> it has been
<Sarayan> cool
<Sarayan> compiling lalala
<Sarayan> (it generates a *big* c++ file :-)
<whitequark> sure does
<Sarayan> I'm always amused at having to raise the bracket-depth
<Sarayan> no visible change
<whitequark> ah, so not that then
<whitequark> please let me know what the issue is!
<Sarayan> yeah, when I find it :-)
<Sarayan> but I shall
mewt has quit [Read error: Connection reset by peer]
<Sarayan> funnily enough, a lot more stuff happens when you actually raise (disable) the HALTn pin
<Sarayan> there's a fair chance the 68k actually works
<whitequark> oooh
<Sarayan> I wouldn't have guessed that the halt pin halted on the next memory access
<Sarayan> and not immediately
<Sarayan> the 68k does 5 micro-ops at reset before starting to read the vectors
<Sarayan> ok, not only the 68k is working, but it's executing a stream of nops at roughly 200KHz on my laptop
<whitequark> is that good?
<Sarayan> well, you tell me, but for that level of emulation I suspect it is
<Sarayan> 1/400th of real time for a typical 8MHz 68k
<Sarayan> 1/40th of real time for a typical 8MHz 68k
<Sarayan> stop the zero inflation :-)
<whitequark> seems like there are feedback arcs
<Sarayan> yeah
<Sarayan> plan to do a nmigen version at some point. Didn't write that one
<Sarayan> Just want to be able to bisimulate with a know good low-level core
<whitequark> run `-p 'hierarchy -auto-top; proc; flatten; splitnets -driver; clean -purge; splitnets -driver; clean -purge' -b cxxrtl`
<Sarayan> okay
* Sarayan adds the black magic
<Sarayan> I put that as a yosys command between hierarchy and write_cxxrtl?
<whitequark> can you show me your current script?
<Sarayan> oh, I see, it's a series of commands in fact
<whitequark> I'll adjust it
<Sarayan> yosys <<EOF
<Sarayan> hierarchy -top fx68k
<Sarayan> EOF
<Sarayan> read -vlog95 m68k.v
<whitequark> that'd be simpler
<Sarayan> write_cxxrtl m68k.cc
<tpb> Title: debian Pastezone (at paste.debian.net)
<Sarayan> compiling
<Sarayan> crashed...
<whitequark> hm, crashed?
<Sarayan> main.cc:79:8: error: no member named 'p_microAddr' in 'cxxrtl_design::p_fx68k'
<Sarayan> m68k.p_microAddr.get<uint32_t>());
<Sarayan> if(!m68k.p_ASn) {
<Sarayan> main.cc:105:8: error: invalid argument type 'wire<1>' to unary expression
<Sarayan> ~~~~ ^
<Sarayan> ^~~~~~~~~~~
<Sarayan> main.cc:123:8: error: value of type 'wire<1>' is not contextually convertible to 'bool'
<Sarayan> if(m68k.p_ASn) {
<Sarayan> ^~~~~~~~~~
<whitequark> ohh
<Sarayan> hmmm, miroaddr is debug stuff I read, I can remove it
<whitequark> and for the others use .get<bool>()
<Sarayan> running...
<Sarayan> twice faster, 400KHz
<whitequark> yep
<whitequark> should be able to get to 600 KHz at least but this requires some ideas i have in development
<Sarayan> very nice
<Sarayan> you want me to package that code for benching?
<whitequark> sure why not
<Sarayan> I'll do that
<whitequark> thank you ^^
Max-P5 has joined #yosys
Lord_Nightmare2 has joined #yosys
lkcl- has joined #yosys
Lord_Nightmare has quit [*.net *.split]
Max-P has quit [*.net *.split]
kbeckmann has quit [*.net *.split]
lkcl has quit [*.net *.split]
philtor has quit [*.net *.split]
TFKyle has quit [*.net *.split]
Lord_Nightmare2 is now known as Lord_Nightmare
Max-P5 is now known as Max-P
TFKyle has joined #yosys
kbeckmann has joined #yosys
philtor has joined #yosys
vidbina has quit [Ping timeout: 252 seconds]
<whitequark> you can use `-I$(yosys-config --datdir/include)` to make it not dependent on your $HOME
<whitequark> (not an issue, just something you might find useful)
<whitequark> and the conventional extension for yosys scripts is `.ys`
<Sarayan> /usr/local/share/yosys/include
<Sarayan> nope
<Sarayan> not picking the correct one
<whitequark> hmm how'd you install yosys?
<Sarayan> probably a compile issue, installed with make install PREFIX=/people/galibert
<Sarayan> I should have used PREFIX at compile? config? time too?
vidbina has joined #yosys
<whitequark> ~430 kHz here
<Sarayan> nice
<whitequark> 2.73 IPC according to `perf stat`
<Sarayan> not bad
<Sarayan> not bad at all
<Sarayan> ok, after recompiling yosys with PREFIX= all the time, --datdir is correct
<Sarayan> Just 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 be
<whitequark> for comparison, minerva runs at ~2 MHz and has 2.61 IPC
<Sarayan> what's minerva?
<whitequark> RISC-V CPU
<Sarayan> ahhhh ok
<Sarayan> the 68000 has never been designed to be good in a fpga-similar setup :-)
<whitequark> lemme look at the m68k disassembly
<whitequark> (yes, i can actually get useful insight from looking at disassembly of C++ templates stacked dozens of levels deep)
<Sarayan> yeah, but you're special :-P
<Sarayan> more seriously, I'm not even surprised. The point of the template is to have as little code generated as possible in the first place
<Sarayan> handholding the compiler in a way
<whitequark> strangely, no
<Sarayan> no?
<whitequark> the way CXXRTL is designed it actually expects the C++ compiler to be very clever
<Sarayan> It's often to point of my templates, but heh
<whitequark> like, CXXRTL doesn't really work well without really aggressive loop unrolling and constant propagation
<Sarayan> ahhh hok I see what you mean
<Sarayan> I consider that basic, today. It's telling the compiler that "here, that's a constant" that is important
<Sarayan> we don't have automatic method duplication on various possible values of a variable yet, except for some special cases like memcpy
<whitequark> yeah, i see what you mean
<whitequark> that's one way to look at it
<Sarayan> anyway, *very* *very* happy to have fx68k run under cxxrtl
<whitequark> the silliest part is that you didn't need to wait since january
<whitequark> could have just lowered the debug level a bit
<Sarayan> I wasn't waiting, I was doing a thousand other things :-)
<whitequark> but no one told you that in the issue, it seems
<whitequark> ahh okay
<Sarayan> it's you closing the issue that pushed me into testing
<Sarayan> in fact you put something back on my todo list, so technically I should hate you ;-)
<Sarayan> been mapping the m10k tiles on the cyclone v lately, which makes we wonder how one handles specialized blocks like that in nmigen/yosys/nextpnr
<Sarayan> and in cxxrtl for the matter
<whitequark> nmigen has Instance, yosys has black boxes, nextpnr knows how to interpret these black boxes
<whitequark> in cxxrtl you can load the simulation model of the black box
<Sarayan> nice
<Sarayan> lots of plumbing on the horizon, but very nice to see all the pieces are there
<tnt> whitequark: can cxxrtl use the cells_sim.v ?
<tnt> or do you need to write custom models ?
<lofty> Sarayan: Yosys handles them as MISTRAL_M10K blocks, which nextpnr would then put in the correct BELs
<whitequark> tnt: it really depends on the cell
<whitequark> but generally, yes
<whitequark> iirc, i've simulated post-synthesis netlists?
<whitequark> actually let me just do that right now
<Sarayan> lofty: does yosys correctly handle the quartus verilog constructs for them?
<lofty> Yes
<Sarayan> nice
<lofty> They get inferred from Verilog
<lofty> The models are...maybe a bit trickier, because the Quartus boxes are hell, but
<Sarayan> annoyingly, an altsyncram may map to multiple m10k
<Sarayan> so there probably will need to be some layer of "synthesys" at the yosys level if you want to cope with quartus-acceptable constructs
<lofty> Fortunately, I won't.
<lofty> I took a long hard look in the mirror
<lofty> And genuinely: fuck the Quartus boxes
<Sarayan> mwahahahaha
<Sarayan> you should put that on a t-shirt, or a mug
<cr1901> Sarayan: Yes, always pass PREFIX to make when building yosys
mewt has joined #yosys
kristianpaul has quit [Quit: WeeChat 2.3]
piegames has quit [Quit: WeeChat 3.1]
<Sarayan> when it runs in 400KHz mode, can I get the internal signals still by calling something specific?
<whitequark> yes
<whitequark> you can use the debug info
<whitequark> do you know how?
<Sarayan> Not yet
<Sarayan> (Insert upload sequence and me going I know kung fu.... wrong tape)
<tpb> Title: CXXRTL, a Yosys Simulation Backend | Electronics etc… (at tomverbeure.github.io)
<Sarayan> Is -Og implicit at this point?
<whitequark> it's gone
<whitequark> you get all the visibility and all the optimization
<Sarayan> beautiful
<Sarayan> so 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?
<whitequark> can you keep using p_thing for the ports: yes
<Sarayan> (I noticed I can get the "uRom microAddr" variable as p_uRom_2e_microAddr)
<whitequark> you can just use p_uRom_2e_microAddr if you want
<whitequark> it's purely a matter of your convenience in this case
<Sarayan> _2e_ is '.' in fact, right?
<whitequark> other than for ports, CXXRTL does not guarantee that the signals will be exposed as members, and if they do, what name the member will have
<whitequark> yes
<Sarayan> microAddr being a port of the uRom submodule that's why it's visible? or it's just pure luck?
<whitequark> most likely, the net you're looking at has many HDL names
<whitequark> on many levels of hierarchy, and possibly within a single module, too
<whitequark> only one of these names ends up as the name of the class member
<whitequark> and it's kind of arbitrary now
<Sarayan> cute
<whitequark> the debug info has all of the names
<Sarayan> got it grepping the .cc, as one does
<whitequark> and they alias a single physical wire<> or value<>
<whitequark> that's what it is: a precise mapping from HDL level names to the physical storage
<Sarayan> and I get the list through debug_items(items). Surprised you didn't use RVO
<whitequark> look at the implementation
<whitequark> consider also that for hierarchical designs (perhaps with blackboxes) you'd have a tree of debug_items functions in the model
<Sarayan> ok, if you have a tree, ok
<Sarayan> otherwise it would just have been debug_items items; at the start and return items; at the end
<Sarayan> I use RVO a lot, it's so natural code-wise
<whitequark> sure
<Sarayan> ah, one can't copy debug_item around
<whitequark> oh, that's unintentional
<Sarayan> oh cool. it would be nice to make it possible to have global/member ones, which you init at start and use whenever
<whitequark> it's POD
<Sarayan> no default constructor though
<Sarayan> references are POD?
<whitequark> hm?
<whitequark> take a look at its definition
<whitequark> it's a bit weird
<whitequark> because it inherits all the fields from the struct in the C API, just adds a few methods
<Sarayan> oh, it's not reference, it's inheritance
<Sarayan> so the only issue is the lack of default constructor I guess
<whitequark> well
<whitequark> it doesn't have a default state
<whitequark> arguably a design defect, there should've been CXXRTL_INVALID in the type enum or something
<Sarayan> that means you must have pointers and ensure the lifetime of the items structure you passed debug_items
<Sarayan> that's unfortunate
<whitequark> yeah
<whitequark> you could also cast it to the base class and use that directly
<whitequark> that's definitely default-constructible
<Sarayan> cast to a reference to cxxrtl_object before assigning?
<whitequark> yeah
<Sarayan> note that if cxxrtl_object is default-constructible debug_item has no reason not to be, since it has no extra fields
<whitequark> well
<whitequark> cxxrtl_object cannot not be default-constructible because it's a C struct
<whitequark> but semantically it still doesn't have a default state
<Sarayan> but it shouldn't be decause it doesn't have a default state?
<Sarayan> yeah
<Sarayan> damned it you do, damned it you don't
<whitequark> it's an oversight
<Sarayan> well, knowing you it'll be fixed at some point :-)
<whitequark> the "right" approach is perhaps to break the ABI and define CXXRTL_INVALID = 0
<whitequark> sigh. yes
<whitequark> you're not wrong
vidbina has quit [Ping timeout: 240 seconds]
gsmecher has joined #yosys
<Sarayan> no get<> in debug_item?
<whitequark> debug_item itself doesn't really have anything user-facing added to it
<whitequark> get<> and set<> would absolutely be handy
<Sarayan> yeah, if you have a C++ wrapper make it cool :-)
<whitequark> please file an issue
<Sarayan> sure
lexano has quit [Remote host closed the connection]
<Sarayan> added two issues
<Sarayan> (default-init and get<>/set<>)
<Sarayan> yep, managed to read the microAddr through the debug_item, nice
FabM has quit [Quit: Leaving]
<whitequark> \o/
Klotz has joined #yosys
lexano has joined #yosys
kristianpaul has joined #yosys
kristianpaul has quit [Changing host]
kristianpaul has joined #yosys
Kamilion has quit [Ping timeout: 252 seconds]
Armleo has joined #yosys
Armleo has quit [Ping timeout: 246 seconds]
Kamilion has joined #yosys
Klotz has quit [Quit: Klotz]
vidbina has joined #yosys
kristianpaul has quit [Quit: WeeChat 2.3]
kristianpaul has joined #yosys
kristianpaul has quit [Changing host]
kristianpaul has joined #yosys
vidbina has quit [Ping timeout: 255 seconds]
Guest4 has joined #yosys
Guest4 has quit [Client Quit]
RaitoBezarius has joined #yosys
Raito_Bezarius has quit [Ping timeout: 240 seconds]
Raito_Bezarius has joined #yosys
RaitoBezarius has quit [Ping timeout: 255 seconds]
Raito_Bezarius has quit [Client Quit]
Raito_Bezarius has joined #yosys
gsmecher has quit [Ping timeout: 268 seconds]