Skip to content

dinismadeira/p4

Repository files navigation

P4 - Pequeno Processador Pedagógico com Pipeline

This is the source code for the Assembler and Simulator for the P4 educational CPU.

You can see the online version here: https://dinismadeira.github.io/p4/

Running the Assembler and Simulator for the P4 educational CPU

On the web browser:

  • Open the index.html file on a web browser.

As an NW.js application:

  • Install NW.js.
  • Put the source code inside a package.nw folder.
  • Run the nw executable.

On a HTTP server:

  • Put the source code in a directory served by your HTTP server.
  • Open the URL for your HTTP server on a web browser.

There's a Minified Web Version Creation Tool in Node.js that allows you to create a minified web version that will load faster.

In order to create a minified version run node web.js. A web folder containing the minified version will be created.

Command Line Assembler for P4

You can create a .p4z zip file with the program and data memory initialization files for P4 from assembly source files using the Command Line Assembler for P4 in Node.js.

Assemble a P4 program:

  • Install packages: npm install
  • Assemble: node p4as.js INPUT_FILE.as

Where INPUT_FILE.as is the name of the P4 assembly source file.

You can set a custom output file by appending the option: -o OUTPUT_FILE where OUTPUT_FILE is the output file.

To show references append the option --show-refs.

Build NW.js executables:

You can create NW.js executables for several operating systems using the nwjs-builder-phoenix Node.js module.

  • Install packages: npm install
  • Create executables: ./node_modules/.bin/build --tasks win-x64,mac-x64,linux-x64,linux-x86,win-x86.

About

Assembler and Simulator for the P4 educational CPU.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors