Skip to content

Commit

Permalink
Preliminary implementation of microcode compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
fsaev committed Aug 5, 2024
1 parent b8e5c3a commit 1bec9c0
Show file tree
Hide file tree
Showing 3 changed files with 413 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"name": "Compile Microcode",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/assembler/main.py",
"program": "${workspaceFolder}/microcode_compiler.py",
"args": [
"${workspaceFolder}/assembler/UART_hello.asm"
"microcode_v1.0.json"
],
"console": "integratedTerminal"
}
Expand Down
33 changes: 33 additions & 0 deletions microcode_compiler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import json
import argparse



def parse_json(json_file):
with open(json_file, 'r') as f:
return json.load(f)

def compile_microcode(microcode_def):


def main():
# Args
parser = argparse.ArgumentParser(
description='Fetchie Microcode Compiler',
epilog='Example: python3 microcode_compiler.py /path/to/json')
parser.add_argument('filename', nargs='?', metavar='/path/to/json',
help='Path to JSON file')
parser.add_argument('--version', action='store_true',
help='Print version info')
args = parser.parse_args()

if args.version:
print('Fetchie Microcode Compiler v0.1 - (C) fsaev 2024')
return

json_file = args.filename
microcode_def = parse_json(json_file)
print(microcode_def)

if __name__ == '__main__':
main()
Loading

0 comments on commit 1bec9c0

Please sign in to comment.