-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preliminary implementation of microcode compiler
- Loading branch information
Showing
3 changed files
with
413 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Oops, something went wrong.