Skip to content

Instantly share code, notes, and snippets.

@btashton
Last active July 31, 2020 19:28
Show Gist options
  • Save btashton/4aa7ed42bc81ff4716821636997d9df9 to your computer and use it in GitHub Desktop.
Save btashton/4aa7ed42bc81ff4716821636997d9df9 to your computer and use it in GitHub Desktop.
ecall debugging for SERV core
@DaveBerkeley
Copy link

Just tried your mpie branch. Still not working for my case.

I'm new to risc-v, so I may be missing something. I've been wrapping SERV with a SoC to allow XIP (execute in place) directly from Flash on the icebreaker.

https://github.com/DaveBerkeley/fpga/tree/master/serv

This is all working fine, except I can't enable the timer interrupt.

@btashton
Copy link
Author

Oh excellent work! I can take a look later today. Do you have a full code listing where you use these functions I could look at?

@DaveBerkeley
Copy link

DaveBerkeley commented Jul 31, 2020

https://github.com/DaveBerkeley/fpga/blob/master/serv/firmware.c

But I'm using my own timer hardware

https://github.com/DaveBerkeley/fpga/blob/master/serv/timer.v

I was embarrassed to find that it adds 500 LUTs to the usage (including the irq code in SERV). My timer has 2 x 64-registers and a 32-bit temp register.

If you compile with -O1 optimisation gcc does a great job of producing minimal code.

I'm also using a hardware uart for tx which you might like. It delays ack until the next byte can be sent, which removes the need for bit-banging or polling the uart for busy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment