forked from sagalpreet/RISC-V-Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (29 loc) · 1.03 KB
/
main.py
File metadata and controls
35 lines (29 loc) · 1.03 KB
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
34
35
print('Enter 1 for pipelined, 2 for non pipelined: ')
pipelined = int(input())
print(
'Enter cache size (in bytes), number of blocks per set, block size (in bytes) [space separated]')
cacheSize, numBlocksPerSet, blockSize = map(int, input().strip().split())
numSet = cacheSize // (blockSize*numBlocksPerSet)
if pipelined == 1:
from pipelined.control import *
from pipelined.gui import *
print('Enter 1 for forwarding, 2 for not-forwarding: ')
forwarding = int(input())
print('Enter 1 for printing registers, 2 for not: ')
printreg = int(input())
control = Control(numSet, numBlocksPerSet, blockSize)
if forwarding == 1:
control.forwarding = True
else:
control.forwarding = False
if printreg == 1:
control.print_registers = True
else:
control.print_registers = False
w = window(control)
else:
from non_pipelined.control import *
from non_pipelined.gui import *
control = Control(numSet, numBlocksPerSet, blockSize)
w = window(control)
w.root.mainloop()