diff --git a/compiler/characterizer/fake_sram.py b/compiler/characterizer/fake_sram.py index 7eb1deb4..223f6868 100644 --- a/compiler/characterizer/fake_sram.py +++ b/compiler/characterizer/fake_sram.py @@ -48,6 +48,7 @@ class fake_sram(sram_config): self.words_per_row = words_per_row self.compute_sizes() + self.pins = ['vdd', 'gnd', 'clk0'] # TODO: remove clk def setup_multiport_constants(self): """ @@ -90,6 +91,13 @@ class fake_sram(sram_config): self.readonly_ports.append(port_number) port_number += 1 + def str_to_pins(self, s): + pinsRE = re.compile(r'^(\w+)\[(\d+):(\d+)\]') + match = pinsRE.match(s) + port, start, end = match.group(1, 2, 3) + pins = [port + '[' + str(p) + ']' for p in range(int(start) - int(end) + 1)] + return pins + def parse_html(self, filename): """ Parse the HTML file generated from previous SRAM generation @@ -98,8 +106,8 @@ class fake_sram(sram_config): with open(filename, 'r') as html: for line in html: if 'Ports and Configuration' in line: - tableRE = re.compile(r'