.kateproject.d
*/project/
*/project2/
+design
<BaliProject version="3.0" title="padiwa" device="LCMXO2-4000HC-6FTG256C" default_implementation="pulser">
<Options/>
<Implementation title="pulser" dir="pulser" description="pulser" synthesis="synplify" default_strategy="Strategy1">
- <Options def_top="panda_dirc_wasa"/>
+ <Options def_top="panda_dirc_wasa" top="padiwa_pulser"/>
<Source name="../padiwa_pulser.vhd" type="VHDL" type_short="VHDL">
- <Options/>
+ <Options top_module="padiwa_pulser"/>
</Source>
<Source name="../lcd_config.vhd" type="VHDL" type_short="VHDL">
<Options/>
<Source name="../../../trbnet/trb_net_std.vhd" type="VHDL" type_short="VHDL">
<Options/>
</Source>
- <Source name="../../pinout/padiwa_amps.lpf" type="Logic Preference" type_short="LPF">
+ <Source name="../../pinout/panda_dirc_wasa1.lpf" type="Logic Preference" type_short="LPF">
<Options/>
</Source>
</Implementation>
signal bus_write : std_logic;
signal bus_ready : std_logic;
+signal register_1 : std_logic_vector(31 downto 0);
+signal register_2 : std_logic_vector(15 downto 0);
+
+
begin
---------------------------------------------------------------------------
);
-PROC_REGISTERS : process begin
+
+---------------------------------------------------------------------------
+-- Registers
+---------------------------------------------------------------------------
+PROC_WRITE_REGISTERS : process begin
wait until rising_edge(clk_osc);
if bus_write= '1' then
if uart_addr = x"01" then
- lcd_data_i(31 downto 0) <= uart_rx_data;
+ register_1 <= uart_rx_data;
+ elsif uart_addr = x"02" then
+ register_2 <= uart_rx_data(15 downto 0);
+ end if;
+ end if;
+end process;
+
+
+PROC_READ_REGISTERS : process begin
+ wait until rising_edge(clk_osc);
+ bus_ready <= '0';
+ if bus_read = '1' then
+ bus_ready <= '1';
+ if uart_addr = x"01" then
+ uart_tx_data <= register_1;
elsif uart_addr = x"02" then
- lcd_data_i(79 downto 64) <= uart_rx_data(15 downto 0);
+ uart_tx_data <= x"0000" & register_2;
end if;
end if;
end process;
+
---------------------------------------------------------------------------
-- LCD
---------------------------------------------------------------------------
);
-
+
+lcd_data_i(31 downto 0) <= register_1;
+lcd_data_i(63 downto 32) <= (others => '0');
+lcd_data_i(79 downto 64) <= register_2;
+lcd_data_i(87 downto 80) <= uart_addr;
+lcd_data_i(127 downto 96) <= uart_rx_data(31 downto 0);
+lcd_data_i(255 downto 128) <= (others => '0');
--- /dev/null
+FREQUENCY NET clk_i_c 133 MHz;
+
x"80", x"01", x"00", x"00", x"00", x"03", x"80", x"03", x"80", x"01", x"80", x"01", x"80", x"03", x"80", x"03", \r
x"00", x"03", x"00", x"03", x"80", x"03", x"80", x"01", others => x"00");\r
\r
+ attribute syn_romstyle : string;\r
+ attribute syn_romstyle of fontram : constant is "block_rom";\r
+ \r
+ \r
+ \r
type initdc_t is array (0 to 15) of std_logic;\r
constant initdc : initdc_t := ('0','1','0','1','0','0','1','1','1','1','0','1','1','1','1','0');\r
\r
signal tx_send : std_logic;
signal tx_ready : std_logic;
-type rx_state_t is (IDLE,GET_ADDR,GET_BYTE0,GET_BYTE1,GET_BYTE2,GET_BYTE3,DO_WRITE,DO_READ,SEND_BYTE0,SEND_BYTE1,SEND_BYTE2);
+type rx_state_t is (IDLE,GET_ADDR,GET_BYTE0,GET_BYTE1,GET_BYTE2,GET_BYTE3,DO_WRITE,DO_READ,SEND_BYTE0,SEND_BYTE1,SEND_BYTE2,SEND_BYTE3,SEND_TERM);
signal state : rx_state_t;
signal addr : std_logic_vector(7 downto 0) := (others => '0');
signal word : std_logic_vector(31 downto 0) := (others => '0');
READ_OUT <= '0';
WRITE_OUT <= '0';
tx_send <= '0';
+ timer <= timer + 1;
case state is
when IDLE =>
cmd_rd <= '0';
cmd_wr <= '0';
+ timer <= (others => '0');
if rx_ready = '1' then
state <= GET_ADDR;
if rx_data = x"52" then
if READY_IN = '1' then
word <= DATA_IN;
tx_send <= '1';
- tx_data <= DATA_IN(31 downto 24);
+ tx_data <= x"52";
+ state <= SEND_BYTE3;
+ end if;
+ when SEND_BYTE3=>
+ if tx_ready = '1' then
+ tx_send <= '1';
+ tx_data <= word(31 downto 24);
state <= SEND_BYTE2;
end if;
when SEND_BYTE2=>
if tx_ready = '1' then
tx_send <= '1';
tx_data <= word(7 downto 0);
+ state <= SEND_TERM;
+ end if;
+ when SEND_TERM=>
+ if tx_ready = '1' then
+ tx_send <= '1';
+ tx_data <= x"0a";
state <= IDLE;
end if;
-
+
end case;
if RESET = '1' or timeout = '1' then
sync_output : process begin
wait until rising_edge(CLK);
TX <= symbol;
- READY <= ready_sig;
end process;
+ READY <= ready_sig and not SEND;
+
----------------------------
-- Generate Serial Clock
----------------------------