Revision ce5940f8 host/lib/ic_reg_maps/common.py
| b/host/lib/ic_reg_maps/common.py | ||
|---|---|---|
| 173 | 173 |
def get_type(self): |
| 174 | 174 |
return 'boost::uint%d_t'%max(2**math.ceil(math.log(self.get_bit_width(), 2)), 8) |
| 175 | 175 |
|
| 176 |
def generate(name, regs_tmpl, body_tmpl='', file=__file__): |
|
| 176 |
def generate(name, regs_tmpl, body_tmpl='', file=__file__, append=False):
|
|
| 177 | 177 |
#evaluate the regs template and parse each line into a register |
| 178 | 178 |
regs = list(); mregs = list() |
| 179 | 179 |
for entry in parse_tmpl(regs_tmpl).splitlines(): |
| ... | ... | |
| 193 | 193 |
) |
| 194 | 194 |
|
| 195 | 195 |
#write the generated code to file specified by argv1 |
| 196 |
open(sys.argv[1], 'w').write(code) |
|
| 196 |
open(sys.argv[1], 'a' if append else 'w').write(code) |
|
Also available in: Unified diff