# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
-import re
import CRL
import Cfg
class ALU16(Module):
- @staticmethod
- def match_instance(datapath_insts, op, plug_name, inst):
- """
- Guess the position of an instance from its nets connections,
- and put it at the right place in the datapath vector.
-
- :param datapath_insts: vector of bit slices,
- :param op: operator name,
- :param inst: instance to classify,
- :param plug_name: name of the plug to use to guess the bit index,
- :return: boolean, True if the instance has been matched.
- """
- if not inst.getMasterCell().getName().startswith(op):
- return False
- re_net_index = re.compile(r'[^(]+\((?P<index>[\d]+)\)$')
- for plug in inst.getPlugs():
- if plug.getMasterNet().getName() != plug_name:
- continue
- m = re_net_index.match(plug.getNet().getName())
- if not m:
- continue
- bit_slice = datapath_insts[int(m.group('index'))]
- for column in bit_slice:
- if column[0] == op:
- column[1] = inst
- print ("match", plug_name, int(m.group('index')),
- column, inst)
- return True
- break
- return False
-
def place_datapath(self, datapath_insts, x_orig, y_orig, fold):
channel_sff1 = self.to_dbu(0)
with SessionManager():
['sff1', None]])
for inst in self.cell.getInstances():
- if (ALU16.match_instance(datapath_insts, 'nmx2', 'i0', inst) or
- ALU16.match_instance(datapath_insts, 'no2', 'nq', inst) or
- ALU16.match_instance(datapath_insts, 'sff1', 'i', inst)):
+ if (Module.match_instance(datapath_insts, 'nmx2', 'i0', inst) or
+ Module.match_instance(datapath_insts, 'no2', 'nq', inst) or
+ Module.match_instance(datapath_insts, 'sff1', 'i', inst)):
continue
# place to right of add
# -*- coding: utf-8 -*-
from __future__ import print_function
+import re
import Anabatic
import CRL
def ab_height(self):
return self.from_dbu(self.ab.getXHeight())
+ @staticmethod
+ def match_instance(datapath_insts, op, plug_name, inst):
+ """
+ Guess the position of an instance from its nets connections,
+ and put it at the right place in the datapath vector.
+
+ :param datapath_insts: vector of bit slices,
+ :param op: operator name,
+ :param inst: instance to classify,
+ :param plug_name: name of the plug to use to guess the bit index,
+ :return: boolean, True if the instance has been matched.
+ """
+ if not inst.getMasterCell().getName().startswith(op):
+ return False
+ re_net_index = re.compile(r'[^(]+\((?P<index>[\d]+)\)$')
+ for plug in inst.getPlugs():
+ if plug.getMasterNet().getName() != plug_name:
+ continue
+ m = re_net_index.match(plug.getNet().getName())
+ if not m:
+ continue
+ bit_slice = datapath_insts[int(m.group('index'))]
+ for column in bit_slice:
+ if column[0] == op:
+ column[1] = inst
+ print ("match", plug_name, int(m.group('index')),
+ column, inst)
+ return True
+ break
+ return False
+
def compute_ab(self):
""" Compute default abutment box without placement. """
etesian = Etesian.EtesianEngine.create(self.cell)