Skip to main content

Simulation of SAP (Simple As Possible) computer programs from COMP311 (Computer Organization) @ UNC

Project description

SAPsim

Test badge Code style: black Python

Simulation of SAP (Simple As Possible) computer programs from COMP311 (Computer Organization) @ UNC.

SAPsim demo

Install

pip install SAPsim

Your Python version needs to be 3.9+. Check with python --version.

If python doesn't work, try python3. If pip doesn't work, try pip3.

Usage

Write a SAP program in the CSV file format shown below.

Screenshot of ex1.csv in Excel

ex1.csv

You may edit the .csv file with any program (Microsoft Excel, Google Sheets, etc.), as long as you preserve the .csv extension.

Open a Python terminal. Import SAPsim's run() function, and pass the path to your SAP program as an argument.

>>> from SAPsim import run
>>> run("ex1.csv")                 # run ex1.csv at full speed (default)
...
>>> run("ex1.csv", debug=True)     # run ex1.csv in debug (step) mode
...

Note: There is a debug (step) mode, as shown above.

Here's a list of additional settings (e.g., table format).

Rules

It's easy to just mimic the example programs, but if you need it, here's the list of rules for SAPsim programs.

SAP instruction set

SAP instruction set

Documentation

https://SAPsim.readthedocs.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SAPsim-1.0.4.tar.gz (17.1 kB view hashes)

Uploaded Source

Built Distribution

SAPsim-1.0.4-py3-none-any.whl (19.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page