Git Product home page Git Product logo

soc-simulator's Introduction

SoC-Simulator

A Verilator based SoC simulator that allows you to define AXI Slave interface in software.

Features

Device Support:

  • UARTLite
  • Serial 8250 (16550 Compatible)
  • NSCSCC CONFREG (GPIO)

Easy to co-simulate with cemu.

Example Usage

Simulate Rocket-Chip

soc-simulator's People

Contributors

cyyself avatar maxpicca-li avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

soc-simulator's Issues

同步 CEMU 仓库的变更

CEMU 近期有一些变更没有同步到本仓库,这导致使用最新版本的 CEMU 来编译 SOC-Simulator 时出错。

例如 cyyself/cemu@60e812d 这个 commit 会导致编译 SOC-Simulator 时报“missing template arguments before 'cemu_mips'”。

Compile Error

In axi4.hpp, it is supposed to include or you will get error:
axi4.hpp:66:14: error: ‘set’ is not a member of ‘std’ 66 | std::set <void*> s;

incr写事务窄传输时遇到的,w_buffer没有偏移的问题

问题背景:

我在使用soc_simulator实现incr类型的写事务过程中 (burst_len=0, burst_size=3, 数据总线宽度为64,地址总线宽度为32)遇到了一个问题

当窄传输时(一个传输示例如下),soc_simulator遇到了数据写入(axi4_mem.do_write处)为0的问题

image-20220721153645911

仔细阅读源码后,发现程序axi4_slave.hpp:216处,作为存放wdata的w_buffer,传入do_wirte时所添加的偏移地址,in_data_pos始终为0,造成了无法与addr_base+addr添加偏移地址的写地址所对应,因此写入了不存在的0

image-20220721151449057

image-20220721151432862

个人解决办法:

修改axi4_slave.hpp:216的do_write的w_buffer + in_data_posw_buffer + addr,即与前写地址偏移时的偏移量相同。完整216行代码如下:

w_resp = static_cast<axi_resp>(static_cast<int>(w_resp) | static_cast<int>(do_write(addr_base+addr,len,w_buffer+addr)));

修改过后的代码通过了全部cpu_test

最终问题:

  1. 假设写事务过程没有问题,我对soc_simlator修改是否有危害,这种修改是否破坏了模型的正确性
  2. 如果修改有危害,可否给出一种可行的修改方案
  3. 由于我是在测试我的rtl代码实现的axi代码是否有误,因此修改过后的soc_simlator我无法确认是否满足要求,想问一下下面这个写事务是否正确

这里叙述一个我axi的写操作,当我需要往0x800013C地址写入一个word数据时,一个写事务的主要信息:

  • aw_burst = INCR
  • aw_len = 0
  • aw_size = 3
  • aw_addr = 0x80000138
  • w_mask = 0b11110000
  • w_data = 0hxxxx_xxxx_0000_0000

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.