0

vhdl でシフトレジスタを作成しようとしています。

私の問題は、レジスタに値を保存しようとするときです。これは問題を引き起こしているコードです:

architecture behave of chan_mod is
signal adc_shfreg : std_logic_vector(15 DOWNTO 0);
signal dac_shfreg : std_logic_vector(15 DOWNTO 0);

begin
    Rcv_adc:
    process(mclk, reset)
    begin
        if rising_edge(mclk) then
            if (reset = '0') then
                adc_out <= "0000000000000000";
            elsif(chan_on = '1' AND subcycle_cntr = "01" AND chan_sel = '0' AND bit_cntr < 16) then
                adc_shfreg <= adc_shfreg(14 DOWNTO 0) & adcdat;
            end if;
        end if;
    end process;
    adc_out <= adc_shfreg;  --compilation error here

私が得るエラーはこれです:

エラー (10028): chan_mod.vhd(40) でネット "adc_out[13]" の複数の定数ドライバーを解決できません

私のポートを見る必要があるかどうかはわかりませんが、ここにあります:

entity chan_mod is
    Port ( mclk : in std_LOGIC;
             reset : in std_logic;
             chan_on : in std_logic;
             chan_sel : in std_logic;
             adcdat : in std_logic;
             dacdat : out std_logic;
             bit_cntr : in std_logic_vector(4 DOWNTO 0);
             subcycle_cntr : in std_logic_vector(1 downto 0);
             dac_in : in std_logic_vector(15 DOWNTO 0);
             adc_out : out std_LOGIC_vector(15 DOWNTO 0);
             rd : in std_logic;
             wr : in std_logic);
end chan_mod;

(ご想像のとおり、これらのいくつかはコードの後半で使用されるため、私のコードサンプルには含まれていません)

4

1 に答える 1

2

あなたの問題は、並行割り当てを使用するだけでなく、プロセスでadc_outを駆動していることです。リセット ケースのadc_out への割り当てをadc_shfregへの割り当てに置き換える必要があります

architecture behave of chan_mod is
signal adc_shfreg : std_logic_vector(15 DOWNTO 0);
signal dac_shfreg : std_logic_vector(15 DOWNTO 0);

begin
    Rcv_adc:
    process(mclk, reset)
    begin
        if rising_edge(mclk) then
            if (reset = '0') then
                adc_out <= "0000000000000000"; <--- BAD! Replace adc_out with adc_shfreg
            elsif(chan_on = '1' AND subcycle_cntr = "01" AND chan_sel = '0' AND bit_cntr < 16) then
                adc_shfreg <= adc_shfreg(14 DOWNTO 0) & adcdat;
            end if;
        end if;
    end process;
    adc_out <= adc_shfreg;  --compilation error here
于 2012-09-21T11:30:36.227 に答える