Code Monkey home page Code Monkey logo

a7's Introduction

A2

Using simulation to determine victim wire toggle rates

Comment-out debug options in fpga_hardware\cores\top\orpsoc-defines.v For example, you should have

// define ADV_DEBUG // define JTAG_DEBUG

Then make sure the clock generator is the simple one required for simulation (without needing vendor-specific libraries), see fpga_hardware\cores\clkgen\

Open ModelSim GUI program Open the project file a2.mpf Compile all project files (may need to add a work library) Close ModelSim sh runVSIM.sh then type run -all to start simulation The simulation will create a compressed VCD file in the same directory it is run from (e.g., a2.vcd.gz) To edit what signals the VCD tracks or the name of the VCD file edit fpga_hardware\cores\bench\orpsoc_testbench.v

See A2Sim.jpg for an example of a successful simulation. Note that the simulation will not stop on its own as the program being simulated never stops.

This runs simulation from the command line, but it is also possible to run the simulation from inside ModelSim's GUI.

Build an FPGA bitstream

The provided scripts assume that you are using Xilinx ISE and the path to the command line tools has been added to your system's PATH variable.

Select (via uncommenting) the appropriate debug option in fpga_hardware\cores\top\orpsoc-defines.v. If you don't know which debug option to select, you will need to read-up on the two debugging options as well as look at how I have them implemented in the source files. The easiest path forward is to give up on debugging using JTAG and hope that your programs runs well enough to output text to the serial console :).

Then make sure the clock generator is the more complex one that takes advantage of FPGA primitives, see fpga_hardware\cores\clkgen\.

make all

Changing the program loaded into memory

Now that you have simulated the provided program or built and run an FPGA implementation of the default program, you may want to simulate/run your own programs. In order to do that, you will need to write (in C or assembly), compile (using the OR1K gcc toolchain and newlib), and convert the resulting binary into a vmem file suitable for loading directly loading to memory.

Here are the basic steps of the compile and conversion process:

  • Compile your program using the OR1K toolchain
  • Convert the resulting binary file to a bin file using or1k-elf-objdump -O binary
  • Convert the bin file to a vmem file using the bin2vmem utility in software/utils
  • Rename the resulting sram file sram.vmem and replace the file in fpga_hardware/cores/ram_wb
  • If you get illegal instruction exceptions (0x700), you may need to move sram.vmem to fpga_hardware/

a7's People

Contributors

impedimenttoprogress avatar

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.