正常に機能するか、テスト モードにできるエンティティを説明したいと思います。私が持っている一般的な設計は、「実際の」エンティティとテストエンティティをラップするトップレベルのエンティティです。
これを VHDL で表現する最善の方法を見つけようとしていますが、物事を複雑にしすぎているように感じます。
小さな最上位エンティティを考えてみましょう (実際には、もっと多くの I/O があります)。
entity toplevelobject is
port (
in1 : inout std_logic;
in2 : inout std_logic;
out1 : out std_logic;
out2 : out std_logic;
testline : in std_logic;
testclk : in std_logic;
);
end toplevelobject;
これは、「テストライン」の状態に応じて、実際の機能とテスト モードを切り替えることになっています (ハイはテストを意味します)。test モジュールは実際にはclk
出力として以外のすべてを使用することに注意してくださいin_*
。
architecture test_passthrough of toplevelobject is
-- This is the actual module
component real_module
port (
in1 : in std_logic;
in2 : in std_logic;
out1 : out std_logic;
out2 : out std_logic;
clk : in std_logic;
-- Note absence of "testline"
);
end component;
-- This is the test module, which will just put the clk
-- signal out on all pins, or play a tune, or something
component test_module
port (
in1 : out std_logic;
in2 : out std_logic;
out1 : out std_logic;
out2 : out std_logic;
testclk : in std_logic;
-- Note absence of "testline"
);
end component;
signal real_in1, real_in2 : std_logic;
signal real_out1, real_out2 : std_logic;
signal test_in1, test_in2 : std_logic;
signal test_out1, test_out2 : std_logic;
begin
real_0 : real_module port map (
in1 => real_in1,
in2 => real_in2,
out1 => real_out1,
out2 => real_out2,
clk => clk,
);
test_0 : test_module port map (
in1 => test_in1,
in2 => test_in2,
out1 => test_out1,
out2 => test_out2,
testclk => clk,
);
-- Ports that are outputs on both don't need
-- much special attention
out1 <= real_out1 when testline = '0' else test_out1;
out2 <= real_out2 when testline = '0' else test_out2;
end test_passthrough;
だから私はいくつかの質問があります:
ポートの場合、スイッチをオンにするステートメントを
inout
含む 1 つの大きなプロセスを用意する必要がありますか? または、ステートメントを使用した各 I/O のプロセスですか? 理論的には、多数の小さなプロセスが順次実行されるのではなく、同時に実行されると考えていますが、実際にシミュレーションや合成に違いが生じるのでしょうか? 例えば:case ... when
testline
if
passthrough_in1 : process(testline, in1, test_in1) is begin if testline = '0' then real_in1 <= in1; else in1 <= test_in1; end if; end process passthrough_in1;
...対...
passthrough_all : process(in1, test_in1, in2, test_in2, testline) is
case testline is
when '0' =>
real_in1 <= in1;
real_in2 <= in2;
when '1' =>
in1 <= test_in1;
in2 <= test_in2;
end case;
end process passthrough_all;
- これは健全なアプローチですか、それとももっと簡単なものがありますか?
- 私は敏感さについて混乱しています — 私は必要です
passthrough_in1
か?passthrough_all
testline
- ラップされた 2 つのエンティティ間で選択するには
real_in1
/が必要ですか? または、「が高い場合、出力をI / Oに接続しますか?test_in1
」と言う別の方法はありますか?testline
test_module
in_1
toplevelobject
in_1