Implemented init conif and simulation.

This commit is contained in:
id101010
2016-05-23 20:18:20 +02:00
parent be7b88aa4c
commit 90fbb4e730
4 changed files with 116 additions and 33 deletions

View File

@@ -44,7 +44,7 @@ use ieee.numeric_std.all;
--use UNISIM.VComponents.all; --use UNISIM.VComponents.all;
entity lcd_driver is entity lcd_driver is
generic ( NBITS : natural := 16; -- counter bit size generic ( NBITS : natural := 21; -- counter bit size
clk_freq : natural := 50000000; -- frequency of clk (50MHz) in hz clk_freq : natural := 50000000; -- frequency of clk (50MHz) in hz
wait_40000us : natural := 40000; -- wait 40ms wait_40000us : natural := 40000; -- wait 40ms
wait_37us : natural := 37; -- wait 37us wait_37us : natural := 37; -- wait 37us
@@ -84,9 +84,9 @@ architecture Behavioral of lcd_driver is
signal ret_state : display_state := INIT; -- ret_state register signal ret_state : display_state := INIT; -- ret_state register
signal next_ret_state : display_state := INIT; -- next_ret_state register signal next_ret_state : display_state := INIT; -- next_ret_state register
signal cur_counter : unsigned(NBITS-1 downto 0) := (others => '0'); -- 10bit counter signal signal cur_counter : unsigned(NBITS-1 downto 0) := (others => '0'); -- n bit counter signal
signal next_counter : unsigned(NBITS-1 downto 0) := (others => '0'); signal next_counter : unsigned(NBITS-1 downto 0) := (others => '0');
signal ret_counter : unsigned(NBITS-1 downto 0) := (others => '0'); -- 10bit counter signal signal ret_counter : unsigned(NBITS-1 downto 0) := (others => '0'); -- n bit counter signal
signal next_ret_counter : unsigned(NBITS-1 downto 0) := (others => '0'); signal next_ret_counter : unsigned(NBITS-1 downto 0) := (others => '0');
signal next_lcd_db : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); -- next lcd databus signal next_lcd_db : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); -- next lcd databus
@@ -155,7 +155,7 @@ begin
next_lcd_db <= "00000000"; next_lcd_db <= "00000000";
next_lcd_en <= '0'; next_lcd_en <= '0';
next_lcd_rw <= '0'; next_lcd_rw <= '0';
next_lcd_rs <= '1'; next_lcd_rs <= '0';
next_counter <= (others => '0'); next_counter <= (others => '0');
next_ret_state <= SEND_FS; next_ret_state <= SEND_FS;
@@ -196,14 +196,14 @@ begin
next_counter <= (others => '0'); next_counter <= (others => '0');
next_ret_state <= PAUSE; next_ret_state <= PAUSE;
next_ret_counter <= to_unsigned(PAUSE_COUNT,NBITS); next_ret_counter <= to_unsigned(PAUSE_COUNT,NBITS);
next_state <= COUNT; next_state <= PAUSE;
when PAUSE => when PAUSE =>
next_lcd_db <= "00000000"; next_lcd_db <= "00000000";
next_lcd_en <= '0'; next_lcd_en <= '0';
next_lcd_rw <= '0'; next_lcd_rw <= '0';
next_lcd_rs <= '1'; next_lcd_rs <= '0';
next_counter <= (others => '0'); next_counter <= (others => '0');
next_ret_state <= SEND_ES; next_ret_state <= SEND_ES;
@@ -212,6 +212,7 @@ begin
when SEND_ES => when SEND_ES =>
next_lcd_db <= "00000110"; next_lcd_db <= "00000110";
next_lcd_en <= '0'; next_lcd_en <= '0';
next_lcd_rw <= '0'; next_lcd_rw <= '0';
@@ -238,6 +239,7 @@ begin
if(cur_counter >= ret_counter) then if(cur_counter >= ret_counter) then
next_state <= ret_state; next_state <= ret_state;
next_lcd_en <= '1';
end if; end if;
when DONE => when DONE =>

View File

@@ -103,14 +103,13 @@ BEGIN
begin begin
reset <= '1'; reset <= '1';
wait for 100 ns; -- hold reset state for 100 ns.
-- hold reset state for 100 ns.
wait for 100 ns;
reset <= '0'; reset <= '0';
wait for clk_period*10; -- Apply Data
--data = ''
wait for clk_period*10;
-- insert stimulus here -- insert stimulus here

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<wave_config>
<wave_state>
</wave_state>
<db_ref_list>
<db_ref path="/home/aaron/Dokumente/STUDIUM/SEM6/EloSys/EloSysDigital/Projekt/vhdl-yasg/lcd_driver_tb_isim_beh.wdb" id="1" type="auto">
<top_modules>
<top_module name="lcd_driver_tb" />
<top_module name="numeric_std" />
<top_module name="std_logic_1164" />
</top_modules>
</db_ref>
</db_ref_list>
<WVObjectSize size="19" />
<wvobject fp_name="/lcd_driver_tb/clk" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">clk</obj_property>
<obj_property name="ObjectShortName">clk</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/reset" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">reset</obj_property>
<obj_property name="ObjectShortName">reset</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/data" type="array" db_ref_id="1">
<obj_property name="ElementShortName">data[7:0]</obj_property>
<obj_property name="ObjectShortName">data[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/new_character" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">new_character</obj_property>
<obj_property name="ObjectShortName">new_character</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/new_pos" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">new_pos</obj_property>
<obj_property name="ObjectShortName">new_pos</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/auto_incr_cursor" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">auto_incr_cursor</obj_property>
<obj_property name="ObjectShortName">auto_incr_cursor</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/lcd_db" type="array" db_ref_id="1">
<obj_property name="ElementShortName">lcd_db[7:0]</obj_property>
<obj_property name="ObjectShortName">lcd_db[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/lcd_en" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">lcd_en</obj_property>
<obj_property name="ObjectShortName">lcd_en</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/lcd_rw" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">lcd_rw</obj_property>
<obj_property name="ObjectShortName">lcd_rw</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/lcd_rs" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">lcd_rs</obj_property>
<obj_property name="ObjectShortName">lcd_rs</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/clk_period" type="other" db_ref_id="1">
<obj_property name="ElementShortName">clk_period</obj_property>
<obj_property name="ObjectShortName">clk_period</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/cur_state" type="other" db_ref_id="1">
<obj_property name="ElementShortName">cur_state</obj_property>
<obj_property name="ObjectShortName">cur_state</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/next_state" type="other" db_ref_id="1">
<obj_property name="ElementShortName">next_state</obj_property>
<obj_property name="ObjectShortName">next_state</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/ret_state" type="other" db_ref_id="1">
<obj_property name="ElementShortName">ret_state</obj_property>
<obj_property name="ObjectShortName">ret_state</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/next_ret_state" type="other" db_ref_id="1">
<obj_property name="ElementShortName">next_ret_state</obj_property>
<obj_property name="ObjectShortName">next_ret_state</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/init_done" type="logic" db_ref_id="1">
<obj_property name="ElementShortName">init_done</obj_property>
<obj_property name="ObjectShortName">init_done</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/cur_counter" type="array" db_ref_id="1">
<obj_property name="ElementShortName">cur_counter[20:0]</obj_property>
<obj_property name="ObjectShortName">cur_counter[20:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/ret_counter" type="array" db_ref_id="1">
<obj_property name="ElementShortName">ret_counter[20:0]</obj_property>
<obj_property name="ObjectShortName">ret_counter[20:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/lcd_driver_tb/uut/cur_lcd_db" type="array" db_ref_id="1">
<obj_property name="ElementShortName">cur_lcd_db[7:0]</obj_property>
<obj_property name="ObjectShortName">cur_lcd_db[7:0]</obj_property>
</wvobject>
</wave_config>

View File

@@ -37,8 +37,10 @@
<file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST_REPORT" xil_pn:name="lcd_driver.syr"/> <file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST_REPORT" xil_pn:name="lcd_driver.syr"/>
<file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST" xil_pn:name="lcd_driver.xst"/> <file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST" xil_pn:name="lcd_driver.xst"/>
<file xil_pn:fileType="FILE_HTML" xil_pn:name="lcd_driver_envsettings.html"/> <file xil_pn:fileType="FILE_HTML" xil_pn:name="lcd_driver_envsettings.html"/>
<file xil_pn:branch="BehavioralSim" xil_pn:fileType="FILE_ISIM_EXE" xil_pn:name="lcd_driver_isim_beh.exe"/>
<file xil_pn:fileType="FILE_XST_PROJECT" xil_pn:name="lcd_driver_stx_beh.prj"/>
<file xil_pn:fileType="FILE_HTML" xil_pn:name="lcd_driver_summary.html"/> <file xil_pn:fileType="FILE_HTML" xil_pn:name="lcd_driver_summary.html"/>
<file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST_PROJECT" xil_pn:name="lcd_driver_tb_beh.prj"/> <file xil_pn:fileType="FILE_XST_PROJECT" xil_pn:name="lcd_driver_tb_beh.prj"/>
<file xil_pn:branch="BehavioralSim" xil_pn:fileType="FILE_ISIM_EXE" xil_pn:name="lcd_driver_tb_isim_beh.exe"/> <file xil_pn:branch="BehavioralSim" xil_pn:fileType="FILE_ISIM_EXE" xil_pn:name="lcd_driver_tb_isim_beh.exe"/>
<file xil_pn:fileType="FILE_ISIM_MISC" xil_pn:name="lcd_driver_tb_isim_beh.wdb"/> <file xil_pn:fileType="FILE_ISIM_MISC" xil_pn:name="lcd_driver_tb_isim_beh.wdb"/>
<file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST_PROJECT" xil_pn:name="lcd_driver_tb_stx_beh.prj"/> <file xil_pn:branch="Implementation" xil_pn:fileType="FILE_XST_PROJECT" xil_pn:name="lcd_driver_tb_stx_beh.prj"/>
@@ -54,21 +56,17 @@
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
</transform> </transform>
<transform xil_pn:end_ts="1463427125" xil_pn:in_ck="4963174131653437457" xil_pn:name="TRAN_copyAbstractToPostAbstractSimulation" xil_pn:start_ts="1463427125"> <transform xil_pn:end_ts="1464024626" xil_pn:in_ck="4963174131653437457" xil_pn:name="TRAN_copyAbstractToPostAbstractSimulation" xil_pn:start_ts="1464024626">
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
<status xil_pn:value="OutOfDateForInputs"/>
<status xil_pn:value="OutOfDateForOutputs"/>
<status xil_pn:value="InputChanged"/>
<status xil_pn:value="OutputChanged"/>
<outfile xil_pn:name="lcd_driver.vhd"/> <outfile xil_pn:name="lcd_driver.vhd"/>
<outfile xil_pn:name="lcd_driver_tb.vhd"/> <outfile xil_pn:name="lcd_driver_tb.vhd"/>
</transform> </transform>
<transform xil_pn:end_ts="1463426002" xil_pn:name="TRAN_xawsToSimhdl" xil_pn:prop_ck="-2560282312695158014" xil_pn:start_ts="1463426002"> <transform xil_pn:end_ts="1464021082" xil_pn:name="TRAN_xawsToSimhdl" xil_pn:prop_ck="-2560282312695158014" xil_pn:start_ts="1464021082">
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
</transform> </transform>
<transform xil_pn:end_ts="1463426002" xil_pn:name="TRAN_schematicsToHdlSim" xil_pn:prop_ck="2072151057923631594" xil_pn:start_ts="1463426002"> <transform xil_pn:end_ts="1464021082" xil_pn:name="TRAN_schematicsToHdlSim" xil_pn:prop_ck="2072151057923631594" xil_pn:start_ts="1464021082">
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
</transform> </transform>
@@ -76,24 +74,16 @@
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
</transform> </transform>
<transform xil_pn:end_ts="1463427127" xil_pn:in_ck="4963174131653437457" xil_pn:name="TRAN_copyPostAbstractToPreSimulation" xil_pn:start_ts="1463427127"> <transform xil_pn:end_ts="1464024634" xil_pn:in_ck="4963174131653437457" xil_pn:name="TRAN_copyPostAbstractToPreSimulation" xil_pn:start_ts="1464024634">
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
<status xil_pn:value="OutOfDateForInputs"/>
<status xil_pn:value="OutOfDateForPredecessor"/>
<status xil_pn:value="OutOfDateForOutputs"/>
<status xil_pn:value="InputChanged"/>
<status xil_pn:value="OutputChanged"/>
<outfile xil_pn:name="lcd_driver.vhd"/> <outfile xil_pn:name="lcd_driver.vhd"/>
<outfile xil_pn:name="lcd_driver_tb.vhd"/> <outfile xil_pn:name="lcd_driver_tb.vhd"/>
</transform> </transform>
<transform xil_pn:end_ts="1463427129" xil_pn:in_ck="4963174131653437457" xil_pn:name="TRAN_ISimulateBehavioralModelRunFuse" xil_pn:prop_ck="-8378225353365721463" xil_pn:start_ts="1463427127"> <transform xil_pn:end_ts="1464024635" xil_pn:in_ck="4963174131653437457" xil_pn:name="TRAN_ISimulateBehavioralModelRunFuse" xil_pn:prop_ck="-8378225353365721463" xil_pn:start_ts="1464024634">
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
<status xil_pn:value="OutOfDateForInputs"/>
<status xil_pn:value="OutOfDateForPredecessor"/>
<status xil_pn:value="OutOfDateForOutputs"/> <status xil_pn:value="OutOfDateForOutputs"/>
<status xil_pn:value="InputChanged"/>
<status xil_pn:value="OutputChanged"/> <status xil_pn:value="OutputChanged"/>
<outfile xil_pn:name="fuse.log"/> <outfile xil_pn:name="fuse.log"/>
<outfile xil_pn:name="isim"/> <outfile xil_pn:name="isim"/>
@@ -102,10 +92,9 @@
<outfile xil_pn:name="lcd_driver_tb_isim_beh.exe"/> <outfile xil_pn:name="lcd_driver_tb_isim_beh.exe"/>
<outfile xil_pn:name="xilinxsim.ini"/> <outfile xil_pn:name="xilinxsim.ini"/>
</transform> </transform>
<transform xil_pn:end_ts="1463427129" xil_pn:in_ck="-2613076747293757950" xil_pn:name="TRAN_ISimulateBehavioralModel" xil_pn:prop_ck="-890565599326071882" xil_pn:start_ts="1463427129"> <transform xil_pn:end_ts="1464024635" xil_pn:in_ck="-1249634404730829457" xil_pn:name="TRAN_ISimulateBehavioralModel" xil_pn:prop_ck="-890565599326071882" xil_pn:start_ts="1464024635">
<status xil_pn:value="SuccessfullyRun"/> <status xil_pn:value="SuccessfullyRun"/>
<status xil_pn:value="ReadyToRun"/> <status xil_pn:value="ReadyToRun"/>
<status xil_pn:value="OutOfDateForPredecessor"/>
<status xil_pn:value="OutOfDateForOutputs"/> <status xil_pn:value="OutOfDateForOutputs"/>
<status xil_pn:value="OutputChanged"/> <status xil_pn:value="OutputChanged"/>
<outfile xil_pn:name="isim.cmd"/> <outfile xil_pn:name="isim.cmd"/>
@@ -148,6 +137,7 @@
<status xil_pn:value="OutOfDateForOutputs"/> <status xil_pn:value="OutOfDateForOutputs"/>
<status xil_pn:value="InputChanged"/> <status xil_pn:value="InputChanged"/>
<status xil_pn:value="OutputChanged"/> <status xil_pn:value="OutputChanged"/>
<status xil_pn:value="OutputRemoved"/>
<outfile xil_pn:name=".lso"/> <outfile xil_pn:name=".lso"/>
<outfile xil_pn:name="_xmsgs/xst.xmsgs"/> <outfile xil_pn:name="_xmsgs/xst.xmsgs"/>
<outfile xil_pn:name="lcd_driver.lso"/> <outfile xil_pn:name="lcd_driver.lso"/>
@@ -157,7 +147,6 @@
<outfile xil_pn:name="lcd_driver.stx"/> <outfile xil_pn:name="lcd_driver.stx"/>
<outfile xil_pn:name="lcd_driver.syr"/> <outfile xil_pn:name="lcd_driver.syr"/>
<outfile xil_pn:name="lcd_driver.xst"/> <outfile xil_pn:name="lcd_driver.xst"/>
<outfile xil_pn:name="lcd_driver_tb_beh.prj"/>
<outfile xil_pn:name="lcd_driver_tb_stx_beh.prj"/> <outfile xil_pn:name="lcd_driver_tb_stx_beh.prj"/>
<outfile xil_pn:name="lcd_driver_xst.xrpt"/> <outfile xil_pn:name="lcd_driver_xst.xrpt"/>
<outfile xil_pn:name="webtalk_pn.xml"/> <outfile xil_pn:name="webtalk_pn.xml"/>