-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmicrocode_compiler.py
More file actions
33 lines (24 loc) · 858 Bytes
/
microcode_compiler.py
File metadata and controls
33 lines (24 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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()