Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIKE functions use in System verilog #1743

Open
svasekar opened this issue Jul 23, 2024 · 2 comments
Open

SPIKE functions use in System verilog #1743

svasekar opened this issue Jul 23, 2024 · 2 comments

Comments

@svasekar
Copy link

I am trying to call sim_t function from spike.cc , in my cpp(c++) wrapper API (provided riscv-isa-sim build as input for compilation) to create shared object, which I will call in System verilog (SV) using DPI call. Idea is to use SPIKE source functions in SV testbench to get SPIKE results for an instruction as input. Will not cal SPIKE coammand in this flow. Alos loaded the elf file with linker script and program.S file (instruction input) to SPIKE and expecting SPIKE to execute its own flow/stack and then will call processor functions to get states, csr, registers in CPP file. however SPIKE stuck in mmu.cc flush_icache, I think i need to initialize ic, dc.
Question is this flow will work?
I

@jerryz123
Copy link
Collaborator

Using spike as a functional model for cosimulation via DPI works. Here is some example code demonstrating this use case. https://github.com/ucb-bar/testchipip/blob/master/src/main/resources/testchipip/csrc/cospike_impl.cc

@svasekar
Copy link
Author

svasekar commented Aug 1, 2024

HI Jerryz123,
Thanks a lot. While making an instance sim_t and calling run in cpp wrapper function, found that SPIKE stuck at function for icache. Not sure what could be the reason. In inital cfg-> ic/dc should we provide init values to it.
Also I am not calling SPIKE as such , wanted to sue only functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants