在使用 VHDL 測驗平臺進行測驗時,我們將 I/O 從我們正在測驗的設計映射到測驗平臺的 I/O。
對我來說,給我們設計的輸入一些從測驗臺生成的值然后觀察設計的輸出并檢查它是否符合我們的預期是有意義的。(就像在單元測驗中一樣)
但是在定義測驗平臺的架構時:
architecture behavior of tb is
signal tb_input : std_logic := '0';
signal tb_output: std_logic := '0';
-- Component decl. for the Unit under Test (UUT)
component design_to_test is
port (
input : in std_logic;
output: out std_logic);
end component design_to_test;
begin
-- Here we initiate the UUT
UUT : design_to_test
port map (
input => tb_input
-- this is what I don't understand. Why are we
giving the input of our design to the testbench?
output => tb_output
-- this makes sense to me as we have to observe the
the output of our design.
);
-- main testing
end behavior;
所以基本上我不明白的部分是我們如何使用測驗臺的輸入。為什么我們不定義一些輸入,然后將其提供給設計進行評估?
uj5u.com熱心網友回復:
實際上,您需要刺激 UUT 的輸入。
目前您的測驗臺還沒有完成。
添加一些序列以將不同的值分配給tb_input.
然后添加一些tb_output帶有預期值的檢查。
只是告訴模擬器(或合成器,port map如果你正在合成)哪些埠連接到外層的哪些信號。
所以input => tb_input并不意味著資料從input流向tb_input。它說埠input必須連接到信號tb_input。資料方向來自in和out關鍵字。
將其視為IC插座和連接的網路,這是外層的信號,以及插入插座的IC及其引腳,這是您的組件的埠。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/453598.html
下一篇:無法在單元測驗中模擬服務
