Skip to content

Commit

Permalink
modules/*/wb_acq_core/*: fix wrong generic use on facq top-level
Browse files Browse the repository at this point in the history
We must use g_facq_channels instead of c_acq_channels,
as the widths are different! The former has the "user"
width (up to 1024 bits). The later has the "internal"
width (up to 128 bits) plus the number of coalescing
words (aggregating the 1024 bits).
  • Loading branch information
lerwys committed Jul 22, 2016
1 parent 2008e17 commit e9d2ad2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions hdl/modules/dbe_wishbone/wb_facq_core/wb_facq_core.vhd
Expand Up @@ -205,26 +205,26 @@ begin

gen_word_packer : for i in 0 to g_acq_num_channels-1 generate

gen_packer_narrow : if c_acq_channels(i).width < c_max_channel_width generate
gen_packer_narrow : if g_facq_channels(i).width < c_max_channel_width generate

-- If we are narrower than c_max_channel_width we must at least divide
-- c_min_channel_width
assert (c_acq_channels(i).width mod c_min_channel_width = 0)
report "[wb_facq_core] c_acq_channels(" & Integer'image(i) &
assert (g_facq_channels(i).width mod c_min_channel_width = 0)
report "[wb_facq_core] g_facq_channels(" & Integer'image(i) &
").width must divide c_min_channel_width (" & Integer'image(c_min_channel_width) &
")"
severity failure;

cmp_gc_word_packer : gc_word_packer
generic map (
g_input_width => to_integer(c_acq_channels(i).width),
g_input_width => to_integer(g_facq_channels(i).width),
g_output_width => c_min_channel_width
)
port map (
clk_i => fs_clk_i,
rst_n_i => fs_rst_n_i,

d_i => acq_val_i(i)(to_integer(c_acq_channels(i).width)-1 downto 0),
d_i => acq_val_i(i)(to_integer(g_facq_channels(i).width)-1 downto 0),
d_valid_i => acq_dvalid_i(i),
d_req_o => open,

Expand All @@ -235,24 +235,24 @@ begin

end generate;

gen_packer_wider : if c_acq_channels(i).width >= c_max_channel_width generate
gen_packer_wider : if g_facq_channels(i).width >= c_max_channel_width generate

assert (c_acq_channels(i).width mod c_max_channel_width = 0)
report "[wb_facq_core] c_acq_channels(" & Integer'image(i) &
assert (g_facq_channels(i).width mod c_max_channel_width = 0)
report "[wb_facq_core] g_facq_channels(" & Integer'image(i) &
").width must divide c_max_channel_width (" & Integer'image(c_max_channel_width) &
")"
severity failure;

cmp_gc_word_packer : gc_word_packer
generic map (
g_input_width => to_integer(c_acq_channels(i).width),
g_input_width => to_integer(g_facq_channels(i).width),
g_output_width => c_max_channel_width
)
port map (
clk_i => fs_clk_i,
rst_n_i => fs_rst_n_i,

d_i => acq_val_i(i)(to_integer(c_acq_channels(i).width)-1 downto 0),
d_i => acq_val_i(i)(to_integer(g_facq_channels(i).width)-1 downto 0),
d_valid_i => acq_dvalid_i(i),
d_req_o => open,

Expand Down

0 comments on commit e9d2ad2

Please sign in to comment.