summaryrefslogtreecommitdiff
path: root/tb/sim
diff options
context:
space:
mode:
Diffstat (limited to 'tb/sim')
-rw-r--r--tb/sim/descifrador.py20
-rwxr-xr-xtb/sim/sim.py6
2 files changed, 25 insertions, 1 deletions
diff --git a/tb/sim/descifrador.py b/tb/sim/descifrador.py
index 8fda8b8..2253e6f 100644
--- a/tb/sim/descifrador.py
+++ b/tb/sim/descifrador.py
@@ -1,2 +1,20 @@
+FILE = 'image_processing/out_file'
+SIZE = 640 * 480 * 4
+START = 0x10000
+
+loads = {START: FILE}
+consts = {0x30050000: 1, 0x30060000: 0}
+cycles = 10000000
+mem_dumps = [range(START, START + SIZE)]
+
def final():
- pass \ No newline at end of file
+ words = []
+ i = 0
+ with open(FILE, 'rb') as file:
+ while data := file.read(4):
+ words.append(int.from_bytes(data, 'little') ^ 0x00ffffff)
+ i += 1
+ if i == 10:
+ break
+
+ assert_mem(START, words)
diff --git a/tb/sim/sim.py b/tb/sim/sim.py
index 0c8b023..b14e0fd 100755
--- a/tb/sim/sim.py
+++ b/tb/sim/sim.py
@@ -261,6 +261,12 @@ for rng in mem_dumps:
for r, value in init_regs.items():
exec_args.extend(['--init-reg', f'{r}={value}'])
+for addr, const in module_get('consts', {}).items():
+ exec_args.extend(['--const', f'{addr},{const}'])
+
+for addr, filename in module_get('loads', {}).items():
+ exec_args.extend(['--load', f'{addr},{filename}'])
+
init_regs = None
exec_args.append(image)