aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/ic_reg_maps/gen_max2829_regs.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-07-01 13:52:11 -0700
committerMartin Braun <martin.braun@ettus.com>2015-07-14 14:51:32 -0700
commit4b1034b29e57a0b405fc89de4602819a4b8cc970 (patch)
treeabdb2918d100cb2e959165013bffbd461a66b2c4 /host/lib/ic_reg_maps/gen_max2829_regs.py
parent7c6bc34f625e3945458a0a2a281850513a02ef08 (diff)
downloaduhd-4b1034b29e57a0b405fc89de4602819a4b8cc970.tar.gz
uhd-4b1034b29e57a0b405fc89de4602819a4b8cc970.tar.bz2
uhd-4b1034b29e57a0b405fc89de4602819a4b8cc970.zip
uhd: Replacing Cheetah w/ Mako 0.4.2 (allows Python 3 compat)
Diffstat (limited to 'host/lib/ic_reg_maps/gen_max2829_regs.py')
-rwxr-xr-xhost/lib/ic_reg_maps/gen_max2829_regs.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/ic_reg_maps/gen_max2829_regs.py b/host/lib/ic_reg_maps/gen_max2829_regs.py
index 383131c18..dbcb68ec9 100755
--- a/host/lib/ic_reg_maps/gen_max2829_regs.py
+++ b/host/lib/ic_reg_maps/gen_max2829_regs.py
@@ -112,13 +112,13 @@ BODY_TMPL="""\
boost::uint32_t get_reg(boost::uint8_t addr){
boost::uint16_t reg = 0;
switch(addr){
- #for $addr in sorted(set(map(lambda r: r.get_addr(), $regs)))
- case $addr:
- #for $reg in filter(lambda r: r.get_addr() == addr, $regs)
- reg |= (boost::uint16_t($reg.get_name()) & $reg.get_mask()) << $reg.get_shift();
- #end for
+ % for addr in sorted(set(map(lambda r: r.get_addr(), regs))):
+ case ${addr}:
+ % for reg in filter(lambda r: r.get_addr() == addr, regs):
+ reg |= (boost::uint16_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()};
+ % endfor
break;
- #end for
+ % endfor
}
return (boost::uint32_t(reg) << 4) | (addr & 0xf);
}