Git Product home page Git Product logo

Comments (14)

dasiUAH avatar dasiUAH commented on July 17, 2024 1

Hi @lcgamboa,

I have been testing the new board just using the IO ports, doing bitbanging from the simulator side, and it worked with the adxl345 and the hcsr04. With the new support thinks are going to be easier.

I understand that the integration with SPIKE should work well so I will dedicate this month to that goal.
I will keep you informed about my progress or any problems I may face.

Thanks again.

from picsimlab.

lcgamboa avatar lcgamboa commented on July 17, 2024

Hi @dasiUAH ,

Remote TCP was initially developed to work with Ripes, which is a RISCV simulator. The Ripes client is in this repository: https://github.com/lcgamboa/Ripes/blob/external_io_tcp_support/src/io/ioexternalbus.cpp

For the peripherals to work, it is necessary to be synchronized with PICSimLab, so the peripherals must be implemented in PICSimLab and not in the CPU simulator. Like Timer for example.

In PICsimLab there are already functions to implement UART, SPI and I2C controllers (the src/devices/*bitbang files), they would have to be added in the exp_board_RemoteTCP.cc file.
I can try to add those controllers.

To read the input_hcsr04 it would be necessary to use a Timer on the PICSimLab side.

Which RISCV simulator do you intend to use?
Could you share your fake simulator?

Perhaps adding the simulator directly to PICSimLab could be a better option, as with simavr, qemu-stm32, qemu-esp32..., than use TCP/IP.

from picsimlab.

dasiUAH avatar dasiUAH commented on July 17, 2024

Hi @lcgamboa,

Thanks for your response.

I understand that it would be best to integrate the simulator in PICSimLab, I just used the remote interface because it was the easiest way to start using PICSimLab parts and it works great.

For research reasons we are evaluating SPIKE as RISCV simulator and I wonder if I could use it for teaching activities in a more attractive way using the PICSimLab.

Now I am taking a look to bsim_qemu.c and trying to understand the g_board->Run_CPU_ns(GotoNow()); mechanism.

I send you the code I have used to test the remote interface.

main.zip

from picsimlab.

lcgamboa avatar lcgamboa commented on July 17, 2024

Hi @dasiUAH ,

a while ago I found this project based on Spike and I thought about using it instead of Ripes with PICSimLab, but I still don't have time to implement it.

The g_board->Run_CPU_ns(GotoNow()); is a hack to try to synchronize qemu to PICSimLab.
It works satisfactorily, the biggest problem is that qemu is not cycle-accurate and the simulation time is based on the computer's wall time. Basically PICSimLab is updated by a qemu timer (currently every 100ms). Or when some IO operation like reading and writing of pins occurs. When the IO operation occurs, PICSimLab reads the simulation time from qemu and advances the simulation until that time.

When I developed the remote TCP board I still hadn't implemented this part of Run_CPU_ns. I believe it is an solution to synchronize the simulators. It would be enough for the simulator to send the synchronization packet with the simulation time every 100ms and every time it makes an IO request. As Spike and cycle-accurate I think it would work better than the current implementation.

from picsimlab.

lcgamboa avatar lcgamboa commented on July 17, 2024

@dasiUAH

I added a new branch https://github.com/lcgamboa/picsimlab/tree/SyncRemoteTCP with initial support for Run_CPU_ns. Now the simulation works synchronized. I believe it will now work the way you expected. The client only has to update the simulation time with a time close to the wall time for the simulation to run in real time.

Run_ns

Your project with time sync support added:
remote.zip

from picsimlab.

dasiUAH avatar dasiUAH commented on July 17, 2024

Hi @lcgamboa,

I am familiar with the Spike plugin interface and it works well for simulating a memory mapped register interface. The problem is that, to date, it does not allow interrupt generation by the peripheral and this limits its use. Maybe I could implement a custom interface.

I am going to try the SyncRemoteTCP solution you have posted.

Thanks again for your work.

from picsimlab.

lcgamboa avatar lcgamboa commented on July 17, 2024

Hi @dasiUAH ,

as you requested, I added I2C, SPI, UART, and ADC support to the RemoteTCP card. I haven't had time to test everything yet. I updated the branch SyncRemoteTCP.

from picsimlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.