Skip to content

Commit

Permalink
added a function read binary control store in CCLightMicrocode
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangmy61 committed Apr 11, 2018
1 parent ae247a8 commit 7dbda98
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ def disa_bin_microcode(self, microcode):
def print_pure_cs_line(self, cs_line):
(condition, op_type_left, cw_left, op_type_right, cw_right) = \
self.disa_cs_line(cs_line)
print(self.CS_format.format(op_type_left, cw_left,
op_type_right, cw_right,
condition))
print(self.CS_format.format(condition, op_type_left, cw_left,
op_type_right, cw_right))

def print_compact_cs_line(self, cs_line):
(condition, op_type_left, cw_left, op_type_right, cw_right) = \
Expand Down Expand Up @@ -253,6 +252,18 @@ def write_to_bin(self, filename=None):
else:
return bin_data

def read_bin(self, filename):
bin_file = open(filename, 'rb')
bin_data = bin_file.read()
bin_file.close()

cs_line_array = self.disa_bin_microcode(bin_data)

print("Condition OpTypeLeft CW_Left OptypeRight CW_Right")
for i in range(len(cs_line_array)):
self.print_pure_cs_line(cs_line_array[i])


def insert_cs_line(self, line_number, condition, op_type_left,
cw_left, op_type_right=0, cw_right=0):
if line_number > 256:
Expand Down

0 comments on commit 7dbda98

Please sign in to comment.