def make_dims(self, node): if node.raw_dims is not None: lengths = [] for raw_dim in node.raw_dims: l = self.bind_visitor.visit(raw_dim[0]) r = self.bind_visitor.visit(raw_dim[1]) lengths.append(vast.Length(l, r)) return vast.Dimensions(lengths) if node.dims is not None: lengths = [] for dim in node.dims: l = vast.IntConst('0') r = vast.Minus(self.bind_visitor.visit(dim), vast.IntConst('1')) lengths.append(vast.Length(l, r)) return vast.Dimensions(lengths) return None
def make_length_msb_lsb(self, msb, lsb): msb = self.bind_visitor.visit(msb) lsb = self.bind_visitor.visit(lsb) return vast.Length(msb, lsb)
def make_length(self, node): msb = vast.IntConst('0') lsb = vast.Minus(self.bind_visitor.visit(node), vast.IntConst('1')) return vast.Length(msb, lsb)