1、編譯仿真庫 A、先將Modelsim安裝目錄C=Modeltech_6.2b下面的modelsim.ini改成存檔格式(取消只讀模式); B、在DOS環(huán)境中,進(jìn)入Xilinx的根目錄,然后依次進(jìn)入bin,nt目錄; C、運行compxlib -s mti_se -f all -l all -o C:Modeltech_6.2bxilinx_libs。 注意:需要根據你安裝的modelsim目錄更改C:Modeltech_6.2b 然后就Ok了,就可以的ISE中啟動(dòng)Modelsim進(jìn)行所有的仿真了。 2、如何在Xilinx ISE中使用Modelsim ISE,Synplify進(jìn)行綜合和仿真 A、打開(kāi)Xilinx ISE,新建一個(gè)Project ①、在菜單File中選擇“New Project”,彈出如下的對話(huà)框: ②、輸入Project名稱(chēng),并選擇好Project保存的路徑,然后下一步: 按照上邊的參數進(jìn)行設置(針對于Spatan 3E的開(kāi)發(fā)板),然后單擊下一步,進(jìn)入到后面的界面: ③、單擊“New Source”按鈕,并按照下面的設置來(lái)操作: ④、參照下面的參數,進(jìn)行設置,然后一直選擇默認選項,一直到完成。 最后生成的項目界面如下圖所示: B、輸入代碼,然后用Synplify綜合 ①、參考代碼: entity Count iS Port(CLK :in STD_LOGIC; RESET :in STD_LOGIC; LOAD :in STD_LOGIC; DATA IN:in STD_LOGIC_VECTOR(3 downto 0); Qout :out STD_LOGIC_VECTOR(3 downto 0)); end Count; architecture Behavioral of Count is signal tmpCount:STD_LOGIC_VECTOR(3 downto 0); begin process(CLK,RESET,LOAD) begin if RESET='1' then tmpCount<="0000"; else if LOAD='1' then tmpCount<=DATA_IN; elsif CLK'event and CLK='1' then tmpCount<=tmpCount+1; end if; end if; end process; Qout<=tmpCount: end Behavioral; ②、雙擊Processes窗口里面的“Synthesize-Synplify”進(jìn)行綜合 ③、在“Transcript”窗口中的可以看到綜合的信息。 C、時(shí)序仿真 ①、從菜單“Project”中選擇“New source”。按照下圖所示輸入,然后選擇下一步 ②、在“Associate source”選擇需要進(jìn)行時(shí)序仿真的HDL代碼,然后選擇下一步 ③、在彈出的窗口“Initial Timing and Clock Wizard-Initialize Timing”中選擇默認的配置 ④、當出現如下的界面后,你就可以進(jìn)行時(shí)序仿真了。 ⑤、在Sources選擇Behavioral Simulation,在Processes的ModelsimSimulator中雙擊下面的任何一個(gè)都可以進(jìn)行仿真。區別就是一個(gè)在XilinxISE中進(jìn)行,一個(gè)則在ModelSim界面中。 ⑥、下圖是雙擊“Ge nerate Expected Simulation Results”的效果 ⑦、下圖是雙擊“Simulate Behavioral Model”的效果 |