M
MM
Guest
Hi all,
This problem has been bugging me since long time ago. Every time I design a
device register map I need to implement several write only bits here and
there. Having these bits prevents me from describing my register file in a
simple and straightforward way... I used to group these WO bits in the MSBs,
so that when I do something of this sort:
process(lclk)
begin
if rising_edge(lclk) then
if cs_ctrl='1' and lwr='1' then
ctrl_reg <= lad(CTRL_SZ-1 downto 0);
end if
if cs_xxx='1' and lwr='1' then
xxx_reg <= lad(XXX_SZ-1 downto 0);
end if
-- etc.
end if;
end process
where CTRL_SZ (assuming the WO bits are in the ctrl_reg) is actually less
than the full register size by the number of WO bits, it kind of solves the
problem, but I don't like the fact that I have to group these bits and that
CTRL_SZ doesn't properly reflect the register size anymore...
So, I was wondering if someone knows a nicer trick to solve this problem...
Thanks,
/Mikhail
This problem has been bugging me since long time ago. Every time I design a
device register map I need to implement several write only bits here and
there. Having these bits prevents me from describing my register file in a
simple and straightforward way... I used to group these WO bits in the MSBs,
so that when I do something of this sort:
process(lclk)
begin
if rising_edge(lclk) then
if cs_ctrl='1' and lwr='1' then
ctrl_reg <= lad(CTRL_SZ-1 downto 0);
end if
if cs_xxx='1' and lwr='1' then
xxx_reg <= lad(XXX_SZ-1 downto 0);
end if
-- etc.
end if;
end process
where CTRL_SZ (assuming the WO bits are in the ctrl_reg) is actually less
than the full register size by the number of WO bits, it kind of solves the
problem, but I don't like the fact that I have to group these bits and that
CTRL_SZ doesn't properly reflect the register size anymore...
So, I was wondering if someone knows a nicer trick to solve this problem...
Thanks,
/Mikhail