GithubHelp home page GithubHelp logo

hirish99 / 7test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gttotev/7test

0.0 0.0 0.0 3.81 MB

Test framework for MIPS CPU from lab07, cs154

Python 33.65% Shell 26.20% Assembly 40.14%

7test's Introduction

7test

Test framework for MIPS CPU from lab07, cs154

Features

  • AUTOMATIC assembly of MIPS assembly programs (using MARS)
  • EXCELLENT selection of crowd-sourced example tests
  • EASY test definition: all you need is three simple text files!
  • QUICK turnaround in CPU development and testing cycles
  • EXTENSIBLE test runner and simulation code: bash and Python code, respectively

Installation

Clone this repo anywhere you see fit

Usage

Basic

./run_tests.sh LAB07_DIR [test]

Where:

  • LAB07_DIR is the path to the directory containing your cpu.py
  • test is the name of the test to run, from names of test/ subdirs; omit to run all tests

Test format

You can easily define your own tests for 7test to execute

Each test lives in its own subdir of tests/ and can contain:

  • prgm.asm: (optional) MIPS assembly program, see 'MARS assembler' section below
  • prgm.hex: assembled program, one hex instruction per line
  • rf.exp: register file expected values
  • dm.exp: data memory expected values

The *.exp files are exhaustive and have the following format:

<ADDR> <VALUE>
...

Hex numbers must be specified with a leading 0x, otherwise decimal is assumed

See:

  • tests/ for examples
  • cpu_test.py for simulation code (including test file parsing)
  • run_tests.sh for the test runner (bash connoisseurs only ;)

MARS assembler

If you include a prgm.asm file in a test dir, it will be assembled automatically into prgm.hex using the bundled MARS assembler when running tests

Making changes to prgm.asm later will cause it automatically reassemble, leading to a drastically shortened testing cyle

Note: you will still need to manually fill out rf.exp and dm.exp

To use MARS to manually assemble file prgm.asm into prgm.hex (as seen in run_tests.sh):

java -jar ./bin/mars.jar a dump .text HexText prgm.hex prgm.asm

DISCLAIMER: using MARS to auto-assemble may result in generated code using $at which may cause tests to fail if not taken into account. Use at your own risk!

Contributing

It's easy to write your own 7test! And very commendable to contribute it back!

  • Fork the GitHub repo and clone it down
  • Make a new branch locally, preferably named test/<testname>
  • Write your new test in tests/<testname>/
  • Try it out using run_tests.sh
  • Make a Pull Request to the GitHub repo from your branch (and fork)

7test's People

Contributors

gttotev 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.