Observed since 20 Oct, 18:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
16ttac-sim
16 Bit Transport Triggered Architecture CPU Simulator
A compiler and simulator written in TypeScript for an imaginary 16bit Transport Triggered Architecture CPU.
All sources and destinations are completely customizable, but you can look here to see the descriptions of all of them that are available by default.
Here is a small code snippet that should explain the whole syntax:
//Comments are single line
//Some example variable declarations:
word var = 123
word var2 = 0x5
word string[10] = "hello"
word string2[10] = [09,98,'c']
word MUL_ARR[10][2] = [[0,1], [2,3], "a"]
//Some example instructions:
SOURCE => DESTINATION
SOURCE => DESTINATION c //Executes only if the carry flag is set
SOURCE => DESTINATION z //Executes only if the zero flag is set
SOURCE => DESTINATION c z //Executes only if the carry and the zero flag are set
//Source can also be a constant value, provided by the operand
123 => DESTINATION
0xFFFF => DESTINATION
'a' => DESTINATION
//Source can also be a reference to a variable
string => ADR
var2 => ADR
//Labels:
label:
123 => ACC
another_label:
string => PUSH
The toolchain is written in TypeScript, it is made to work both in web and node. It also works as a standalone tool that you can use with npx.
$ npx 16ttac-sim -h
$ npx 16ttac-sim examples/numbers.txt
$ npm i 16ttac-sim
//Include the required files...
const parser = new Parser();
const compiler = new Compiler();
const program = new Command();
let simRunning = true;
const sim = new Sim({
haltCallback: () => {
console.log("\n\nHalting");
simRunning = false;
}
});
sim.initializeMemory(compiler.compile(parser.parse(sourceCode)));
while(simRunning) sim.singleStep();
For more complicated examples with IO, look at cli.ts and sim.test.ts.
The main advantage of Transport Triggered Architecture is the ease of adding custom instructions, to do so you can extend the defaultInstructionDictionary or you can create your own dictionary.
A dictionary needs one source with isOperand set for the toolchain to work correctly.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
ohm-jsEnvironment{
"local_name": "ohm-js",
"alias": false,
"peer_metadata": null
} | ^16.4.0 | runtime |
commanderEnvironment{
"local_name": "commander",
"alias": false,
"peer_metadata": null
} | ^9.4.1 | runtime |
jestEnvironment{
"local_name": "jest",
"alias": false,
"peer_metadata": null
} | ^29.3.1 | development |
huskyEnvironment{
"local_name": "husky",
"alias": false,
"peer_metadata": null
} | ^8.0.2 | development |
nodemonEnvironment{
"local_name": "nodemon",
"alias": false,
"peer_metadata": null
} | ^2.0.20 | development |
ts-jestEnvironment{
"local_name": "ts-jest",
"alias": false,
"peer_metadata": null
} | ^29.0.3 | development |
ts-nodeEnvironment{
"local_name": "ts-node",
"alias": false,
"peer_metadata": null
} | ^10.9.1 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | 2.8.1 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^4.9.3 | development |
@types/jestEnvironment{
"local_name": "@types/jest",
"alias": false,
"peer_metadata": null
} | ^29.2.4 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^18.11.11 | development |
lint-stagedEnvironment{
"local_name": "lint-staged",
"alias": false,
"peer_metadata": null
} | ^13.1.0 | development |
Source distribution
{
"shasum": "188143b6a444f10861240bf3626f3a0c9d509f29",
"tarball": "https://registry.npmjs.org/16ttac-sim/-/16ttac-sim-1.0.8.tgz",
"fileCount": 21,
"integrity": "sha512-Ico5NmpCpqHqIM/zy7e4IKO8TTainD0+J/32nfZ77ObC8BVCPCMvNjXtfgmheX2N2O4UsuAxkts2hO2M0VnpVg==",
"signatures": [
{
"sig": "MEQCIH2T5hsEuZxwViVE1vOoGGqLTb7W8hwPM2eWaOYhD+tqAiAfK9/ime595SzqgwgGxeuQr8VFx0foJxz0zB0zesbspg==",
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
}
],
"unpackedSize": 34124,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwfYuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPURAAnMuLWP6Z6CsioRWJqS1wyfbSx+9zwe3WJ+IKSKNsPbjkWuj6\r\nDpRevheCRHG/VXDP0qVpz7HZZsOte12+mQ4O2CpHFo/eYzlXtWhdGc/sBdgO\r\nnA9mQcLMjmSfm0MTDdNQj5xSAGH++jiP2Fy/mXRdbqCzqjltxkrwi2tgNoyd\r\ngzpQnZsmeHnvwfsq4Lq21oowTp350Zp55mV0xCjxKQNyXkN3ggRsNSVWwfrw\r\nQ6A8Y3qB6WeISMQCCgxg65fdQhMQPaxz03G6oXvCWVG3PASCXWLDrW0gEhWF\r\nIr4NOsSZYXEPfeJwPOzueu00IVT84xuJfZ5WHTVPlV4heQl8W2XflXGPci42\r\nu26d48omAZxnBQ2B6Qp6XVI1xoxVpLqsHsWNZ41zBk7f1KLCZLMshs/+RDt9\r\ngRS+dZb3TJUui3D6pDAXjbQrn2JgTP4DnHsuStuViG1JMXwFdUB7fykEwpgn\r\nwc5/T1u9PeekHoMu5mDJZlUjao5/YTDPdsfsytewcuLO/nDRadGLcvgdPWpW\r\nrMi2gyyvrOiatPef//YNqHcjEPWHFxFX9SbKGwQ8GJtsY6Xad7Iykt8mFuMZ\r\n/I/xuwSE37HcQUfRhNMsN6KCQ6tUwuW7kcTA2c3Ue3OWWqzN0iz+N8EvCsoc\r\nz/AcKRE+Mo9xb3qlRrO4fEvpKhIjubXNvqk=\r\n=QeVI\r\n-----END PGP SIGNATURE-----\r\n"
}Observed since 20 Oct, 18:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:bb5427ea615a9c3887c3c110e730fd799d82e338951dd652eb232512d037de91