_florent_ changed the topic of #litex to: LiteX FPGA SoC builder and Cores / Github : https://github.com/enjoy-digital, https://github.com/litex-hub / Logs: https://libera.irclog.whitequark.org/litex
tpb has quit [Remote host closed the connection]
tpb has joined #litex
<xobs[m]> I think one of the things that I don't like about RISC-V is that it has 32 general-purpose registers, meaning a context switch is surprisingly heavy. It's 64 cycles at a minimum (32 pushes followed by 32 pops). Occasionally I find myself thinking register windows were a good idea.
ewen_ has joined #litex
<xobs[m]> (Then I come to my senses, of course.)
<swetland> yeah. even interrupts require saving at least 16 registers on the way in. On the other hand at 50MHz, 64 cycles is only 1.28uS so that's survivable
<tpw_rules> does it not have an interrupt register bank?
<swetland> nope. there are 32 general registers (one is always 0) and a pc
<swetland> there is a single scratch machine register that you can use to assist in shuffling stuff around on irq or exception
<swetland> typically you point it at a kernel stack or thread struct or the like and you swap sp with that, then stow the caller-save registers so they're not corrupted, then call into your irq/exception code
<swetland> xobs[m]: my least favorite thing about RISCV is the SBI
<swetland> I really really dislike enshrining a (potentially blackbox) machine monitor (like intel SMI) to handle activities that really should be handled by the OS in supervisor mode
linear_cannon has joined #litex
<xobs[m]> Even more if you've got floating point
ewen_ has quit [Ping timeout: 252 seconds]
toshywoshy has quit [Ping timeout: 240 seconds]
toshywoshy has joined #litex
Degi_ has joined #litex
Degi has quit [Ping timeout: 260 seconds]
Degi_ is now known as Degi
<pepijndevos[m]> Are there any examples for making a peripheral in vhdl? I found on the wiki how to add vhdl instances, but I mean more... How to expose a register that a core can read/write
_franck_ has quit [Read error: Connection reset by peer]
_franck_1 has joined #litex
_franck_1 is now known as _franck_
<_florent_> pepijndevos[m]: you just need to create a mmap peripheral with Wishbone, AXI or AXI-Lite interface and connect it like this:
peeps[zen] has joined #litex
<_florent_> Sorry not sure I have open-source examples to share directly with LiteX, but you could follow any mmap open source core, you'll probably find more Wishbone examples
peepsalot has quit [Ping timeout: 260 seconds]
<pepijndevos[m]> Hmm so you'd need to implement a wishbone thing in vhdl... Something I imagine is built in with litex. Maybe I could just do that part in litex and just have that as a stdlogicvector into vhdl?
<tnt> xobs[m]: I often end up using non-standard extension that "swap" register bank ...
<tnt> pepijndevos[m]: yeah, if all you need is a single register, going using a AutoCSR / CSR thing that creates the register and then just feed it as an input to the instance of you vhdl core seems the easiest.
<pepijndevos[m]> I think I'll just riff on the pwm core
<pepijndevos[m]> Honestly not sure it's even worth going down to VHDL. I want to do a stepper motor driver, which is honestly not much more complicated than PWM. It's just... migen is great for plumbing and metaprogramming but I don't like the syntax for actual logic
<_florent_> pepijndevos[m]: I generally encourage developers to only use LiteX for use-cases they find useful for them, so in your case just doing the plumbing + using AutoCSR with CSR connected to input/output of the VHDL design as suggested tnt seems the best.
<_florent_> pepijndevos[m]: I'm also doing that a lot when re-integrating existing VHDL/Verilog cores and to prototype things with the plumbing in LiteX first and then write things in VHDL when the final architecture is found.
<pepijndevos[m]> sounds good
zjason`` has joined #litex
zjason` has quit [Ping timeout: 256 seconds]
<Wolfvak> hi, after trying the latest linux-on-vexriscv in my orangecrab 25f I find that the available memory is now 64MiB? did I misconfigure something on build or can someone replicate this?
<Wolfvak> used "./make.py --board orangecrab --build --dcache-size 16384 --dcache-ways 4 --icache-size 16384 --icache-ways 4 --with-rvc --load" for building and flashing btw
<cr1901> pepijndevos[m]: If you want your core to be decoupled from your SoC, you may consider something like pythondata-auto to "wrap" your VHDL: https://github.com/litex-hub/pythondata-auto
cr1901 has quit [Ping timeout: 252 seconds]
peeps[zen] has quit [Quit: Connection reset by peep]
peepsalot has joined #litex