content
stringlengths
1
1.04M
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity add_174 is port ( result : out std_logic_vector(19 downto 0); in_a : in std_logic_vector(19 downto 0); in_b : in std_logic_vector(19 downto 0) ); end add_174; architecture augh of add_174 is signal carry_inA : std_logic_vector(21 downto 0); signal carry_inB : std_logic_vector(21 downto 0); signal carry_res : std_logic_vector(21 downto 0); begin -- To handle the CI input, the operation is '1' + CI -- If CI is not present, the operation is '1' + '0' carry_inA <= '0' & in_a & '1'; carry_inB <= '0' & in_b & '0'; -- Compute the result carry_res <= std_logic_vector(unsigned(carry_inA) + unsigned(carry_inB)); -- Set the outputs result <= carry_res(20 downto 1); end architecture;
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity add_174 is port ( result : out std_logic_vector(19 downto 0); in_a : in std_logic_vector(19 downto 0); in_b : in std_logic_vector(19 downto 0) ); end add_174; architecture augh of add_174 is signal carry_inA : std_logic_vector(21 downto 0); signal carry_inB : std_logic_vector(21 downto 0); signal carry_res : std_logic_vector(21 downto 0); begin -- To handle the CI input, the operation is '1' + CI -- If CI is not present, the operation is '1' + '0' carry_inA <= '0' & in_a & '1'; carry_inB <= '0' & in_b & '0'; -- Compute the result carry_res <= std_logic_vector(unsigned(carry_inA) + unsigned(carry_inB)); -- Set the outputs result <= carry_res(20 downto 1); end architecture;
------------------------------------------------------------------------------- -- system_dlmb_cntlr_wrapper.vhd ------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; library lmb_bram_if_cntlr_v3_10_c; use lmb_bram_if_cntlr_v3_10_c.all; entity system_dlmb_cntlr_wrapper is port ( LMB_Clk : in std_logic; LMB_Rst : in std_logic; LMB_ABus : in std_logic_vector(0 to 31); LMB_WriteDBus : in std_logic_vector(0 to 31); LMB_AddrStrobe : in std_logic; LMB_ReadStrobe : in std_logic; LMB_WriteStrobe : in std_logic; LMB_BE : in std_logic_vector(0 to 3); Sl_DBus : out std_logic_vector(0 to 31); Sl_Ready : out std_logic; Sl_Wait : out std_logic; Sl_UE : out std_logic; Sl_CE : out std_logic; LMB1_ABus : in std_logic_vector(0 to 31); LMB1_WriteDBus : in std_logic_vector(0 to 31); LMB1_AddrStrobe : in std_logic; LMB1_ReadStrobe : in std_logic; LMB1_WriteStrobe : in std_logic; LMB1_BE : in std_logic_vector(0 to 3); Sl1_DBus : out std_logic_vector(0 to 31); Sl1_Ready : out std_logic; Sl1_Wait : out std_logic; Sl1_UE : out std_logic; Sl1_CE : out std_logic; LMB2_ABus : in std_logic_vector(0 to 31); LMB2_WriteDBus : in std_logic_vector(0 to 31); LMB2_AddrStrobe : in std_logic; LMB2_ReadStrobe : in std_logic; LMB2_WriteStrobe : in std_logic; LMB2_BE : in std_logic_vector(0 to 3); Sl2_DBus : out std_logic_vector(0 to 31); Sl2_Ready : out std_logic; Sl2_Wait : out std_logic; Sl2_UE : out std_logic; Sl2_CE : out std_logic; LMB3_ABus : in std_logic_vector(0 to 31); LMB3_WriteDBus : in std_logic_vector(0 to 31); LMB3_AddrStrobe : in std_logic; LMB3_ReadStrobe : in std_logic; LMB3_WriteStrobe : in std_logic; LMB3_BE : in std_logic_vector(0 to 3); Sl3_DBus : out std_logic_vector(0 to 31); Sl3_Ready : out std_logic; Sl3_Wait : out std_logic; Sl3_UE : out std_logic; Sl3_CE : out std_logic; BRAM_Rst_A : out std_logic; BRAM_Clk_A : out std_logic; BRAM_EN_A : out std_logic; BRAM_WEN_A : out std_logic_vector(0 to 3); BRAM_Addr_A : out std_logic_vector(0 to 31); BRAM_Din_A : in std_logic_vector(0 to 31); BRAM_Dout_A : out std_logic_vector(0 to 31); Interrupt : out std_logic; UE : out std_logic; CE : out std_logic; SPLB_CTRL_PLB_ABus : in std_logic_vector(0 to 31); SPLB_CTRL_PLB_PAValid : in std_logic; SPLB_CTRL_PLB_masterID : in std_logic_vector(0 to 0); SPLB_CTRL_PLB_RNW : in std_logic; SPLB_CTRL_PLB_BE : in std_logic_vector(0 to 3); SPLB_CTRL_PLB_size : in std_logic_vector(0 to 3); SPLB_CTRL_PLB_type : in std_logic_vector(0 to 2); SPLB_CTRL_PLB_wrDBus : in std_logic_vector(0 to 31); SPLB_CTRL_Sl_addrAck : out std_logic; SPLB_CTRL_Sl_SSize : out std_logic_vector(0 to 1); SPLB_CTRL_Sl_wait : out std_logic; SPLB_CTRL_Sl_rearbitrate : out std_logic; SPLB_CTRL_Sl_wrDAck : out std_logic; SPLB_CTRL_Sl_wrComp : out std_logic; SPLB_CTRL_Sl_rdDBus : out std_logic_vector(0 to 31); SPLB_CTRL_Sl_rdDAck : out std_logic; SPLB_CTRL_Sl_rdComp : out std_logic; SPLB_CTRL_Sl_MBusy : out std_logic_vector(0 to 0); SPLB_CTRL_Sl_MWrErr : out std_logic_vector(0 to 0); SPLB_CTRL_Sl_MRdErr : out std_logic_vector(0 to 0); SPLB_CTRL_PLB_UABus : in std_logic_vector(0 to 31); SPLB_CTRL_PLB_SAValid : in std_logic; SPLB_CTRL_PLB_rdPrim : in std_logic; SPLB_CTRL_PLB_wrPrim : in std_logic; SPLB_CTRL_PLB_abort : in std_logic; SPLB_CTRL_PLB_busLock : in std_logic; SPLB_CTRL_PLB_MSize : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_lockErr : in std_logic; SPLB_CTRL_PLB_wrBurst : in std_logic; SPLB_CTRL_PLB_rdBurst : in std_logic; SPLB_CTRL_PLB_wrPendReq : in std_logic; SPLB_CTRL_PLB_rdPendReq : in std_logic; SPLB_CTRL_PLB_wrPendPri : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_rdPendPri : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_reqPri : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_TAttribute : in std_logic_vector(0 to 15); SPLB_CTRL_Sl_wrBTerm : out std_logic; SPLB_CTRL_Sl_rdWdAddr : out std_logic_vector(0 to 3); SPLB_CTRL_Sl_rdBTerm : out std_logic; SPLB_CTRL_Sl_MIRQ : out std_logic_vector(0 to 0); S_AXI_CTRL_ACLK : in std_logic; S_AXI_CTRL_ARESETN : in std_logic; S_AXI_CTRL_AWADDR : in std_logic_vector(31 downto 0); S_AXI_CTRL_AWVALID : in std_logic; S_AXI_CTRL_AWREADY : out std_logic; S_AXI_CTRL_WDATA : in std_logic_vector(31 downto 0); S_AXI_CTRL_WSTRB : in std_logic_vector(3 downto 0); S_AXI_CTRL_WVALID : in std_logic; S_AXI_CTRL_WREADY : out std_logic; S_AXI_CTRL_BRESP : out std_logic_vector(1 downto 0); S_AXI_CTRL_BVALID : out std_logic; S_AXI_CTRL_BREADY : in std_logic; S_AXI_CTRL_ARADDR : in std_logic_vector(31 downto 0); S_AXI_CTRL_ARVALID : in std_logic; S_AXI_CTRL_ARREADY : out std_logic; S_AXI_CTRL_RDATA : out std_logic_vector(31 downto 0); S_AXI_CTRL_RRESP : out std_logic_vector(1 downto 0); S_AXI_CTRL_RVALID : out std_logic; S_AXI_CTRL_RREADY : in std_logic ); end system_dlmb_cntlr_wrapper; architecture STRUCTURE of system_dlmb_cntlr_wrapper is component lmb_bram_if_cntlr is generic ( C_BASEADDR : std_logic_vector(0 to 31); C_HIGHADDR : std_logic_vector(0 to 31); C_FAMILY : string; C_MASK : std_logic_vector(0 to 31); C_MASK1 : std_logic_vector(0 to 31); C_MASK2 : std_logic_vector(0 to 31); C_MASK3 : std_logic_vector(0 to 31); C_LMB_AWIDTH : integer; C_LMB_DWIDTH : integer; C_ECC : integer; C_INTERCONNECT : integer; C_FAULT_INJECT : integer; C_CE_FAILING_REGISTERS : integer; C_UE_FAILING_REGISTERS : integer; C_ECC_STATUS_REGISTERS : integer; C_ECC_ONOFF_REGISTER : integer; C_ECC_ONOFF_RESET_VALUE : integer; C_CE_COUNTER_WIDTH : integer; C_WRITE_ACCESS : integer; C_NUM_LMB : integer; C_SPLB_CTRL_BASEADDR : std_logic_vector; C_SPLB_CTRL_HIGHADDR : std_logic_vector; C_SPLB_CTRL_AWIDTH : INTEGER; C_SPLB_CTRL_DWIDTH : INTEGER; C_SPLB_CTRL_P2P : INTEGER; C_SPLB_CTRL_MID_WIDTH : INTEGER; C_SPLB_CTRL_NUM_MASTERS : INTEGER; C_SPLB_CTRL_SUPPORT_BURSTS : INTEGER; C_SPLB_CTRL_NATIVE_DWIDTH : INTEGER; C_S_AXI_CTRL_BASEADDR : std_logic_vector(31 downto 0); C_S_AXI_CTRL_HIGHADDR : std_logic_vector(31 downto 0); C_S_AXI_CTRL_ADDR_WIDTH : INTEGER; C_S_AXI_CTRL_DATA_WIDTH : INTEGER ); port ( LMB_Clk : in std_logic; LMB_Rst : in std_logic; LMB_ABus : in std_logic_vector(0 to C_LMB_AWIDTH-1); LMB_WriteDBus : in std_logic_vector(0 to C_LMB_DWIDTH-1); LMB_AddrStrobe : in std_logic; LMB_ReadStrobe : in std_logic; LMB_WriteStrobe : in std_logic; LMB_BE : in std_logic_vector(0 to C_LMB_DWIDTH/8-1); Sl_DBus : out std_logic_vector(0 to C_LMB_DWIDTH-1); Sl_Ready : out std_logic; Sl_Wait : out std_logic; Sl_UE : out std_logic; Sl_CE : out std_logic; LMB1_ABus : in std_logic_vector(0 to C_LMB_AWIDTH-1); LMB1_WriteDBus : in std_logic_vector(0 to C_LMB_DWIDTH-1); LMB1_AddrStrobe : in std_logic; LMB1_ReadStrobe : in std_logic; LMB1_WriteStrobe : in std_logic; LMB1_BE : in std_logic_vector(0 to C_LMB_DWIDTH/8-1); Sl1_DBus : out std_logic_vector(0 to C_LMB_DWIDTH-1); Sl1_Ready : out std_logic; Sl1_Wait : out std_logic; Sl1_UE : out std_logic; Sl1_CE : out std_logic; LMB2_ABus : in std_logic_vector(0 to C_LMB_AWIDTH-1); LMB2_WriteDBus : in std_logic_vector(0 to C_LMB_DWIDTH-1); LMB2_AddrStrobe : in std_logic; LMB2_ReadStrobe : in std_logic; LMB2_WriteStrobe : in std_logic; LMB2_BE : in std_logic_vector(0 to C_LMB_DWIDTH/8-1); Sl2_DBus : out std_logic_vector(0 to C_LMB_DWIDTH-1); Sl2_Ready : out std_logic; Sl2_Wait : out std_logic; Sl2_UE : out std_logic; Sl2_CE : out std_logic; LMB3_ABus : in std_logic_vector(0 to C_LMB_AWIDTH-1); LMB3_WriteDBus : in std_logic_vector(0 to C_LMB_DWIDTH-1); LMB3_AddrStrobe : in std_logic; LMB3_ReadStrobe : in std_logic; LMB3_WriteStrobe : in std_logic; LMB3_BE : in std_logic_vector(0 to C_LMB_DWIDTH/8-1); Sl3_DBus : out std_logic_vector(0 to C_LMB_DWIDTH-1); Sl3_Ready : out std_logic; Sl3_Wait : out std_logic; Sl3_UE : out std_logic; Sl3_CE : out std_logic; BRAM_Rst_A : out std_logic; BRAM_Clk_A : out std_logic; BRAM_EN_A : out std_logic; BRAM_WEN_A : out std_logic_vector(0 to ((C_LMB_DWIDTH+8*C_ECC)/8)-1); BRAM_Addr_A : out std_logic_vector(0 to C_LMB_AWIDTH-1); BRAM_Din_A : in std_logic_vector(0 to C_LMB_DWIDTH-1+8*C_ECC); BRAM_Dout_A : out std_logic_vector(0 to C_LMB_DWIDTH-1+8*C_ECC); Interrupt : out std_logic; UE : out std_logic; CE : out std_logic; SPLB_CTRL_PLB_ABus : in std_logic_vector(0 to 31); SPLB_CTRL_PLB_PAValid : in std_logic; SPLB_CTRL_PLB_masterID : in std_logic_vector(0 to (C_SPLB_CTRL_MID_WIDTH-1)); SPLB_CTRL_PLB_RNW : in std_logic; SPLB_CTRL_PLB_BE : in std_logic_vector(0 to ((C_SPLB_CTRL_DWIDTH/8)-1)); SPLB_CTRL_PLB_size : in std_logic_vector(0 to 3); SPLB_CTRL_PLB_type : in std_logic_vector(0 to 2); SPLB_CTRL_PLB_wrDBus : in std_logic_vector(0 to (C_SPLB_CTRL_DWIDTH-1)); SPLB_CTRL_Sl_addrAck : out std_logic; SPLB_CTRL_Sl_SSize : out std_logic_vector(0 to 1); SPLB_CTRL_Sl_wait : out std_logic; SPLB_CTRL_Sl_rearbitrate : out std_logic; SPLB_CTRL_Sl_wrDAck : out std_logic; SPLB_CTRL_Sl_wrComp : out std_logic; SPLB_CTRL_Sl_rdDBus : out std_logic_vector(0 to (C_SPLB_CTRL_DWIDTH-1)); SPLB_CTRL_Sl_rdDAck : out std_logic; SPLB_CTRL_Sl_rdComp : out std_logic; SPLB_CTRL_Sl_MBusy : out std_logic_vector(0 to (C_SPLB_CTRL_NUM_MASTERS-1)); SPLB_CTRL_Sl_MWrErr : out std_logic_vector(0 to (C_SPLB_CTRL_NUM_MASTERS-1)); SPLB_CTRL_Sl_MRdErr : out std_logic_vector(0 to (C_SPLB_CTRL_NUM_MASTERS-1)); SPLB_CTRL_PLB_UABus : in std_logic_vector(0 to 31); SPLB_CTRL_PLB_SAValid : in std_logic; SPLB_CTRL_PLB_rdPrim : in std_logic; SPLB_CTRL_PLB_wrPrim : in std_logic; SPLB_CTRL_PLB_abort : in std_logic; SPLB_CTRL_PLB_busLock : in std_logic; SPLB_CTRL_PLB_MSize : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_lockErr : in std_logic; SPLB_CTRL_PLB_wrBurst : in std_logic; SPLB_CTRL_PLB_rdBurst : in std_logic; SPLB_CTRL_PLB_wrPendReq : in std_logic; SPLB_CTRL_PLB_rdPendReq : in std_logic; SPLB_CTRL_PLB_wrPendPri : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_rdPendPri : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_reqPri : in std_logic_vector(0 to 1); SPLB_CTRL_PLB_TAttribute : in std_logic_vector(0 to 15); SPLB_CTRL_Sl_wrBTerm : out std_logic; SPLB_CTRL_Sl_rdWdAddr : out std_logic_vector(0 to 3); SPLB_CTRL_Sl_rdBTerm : out std_logic; SPLB_CTRL_Sl_MIRQ : out std_logic_vector(0 to (C_SPLB_CTRL_NUM_MASTERS-1)); S_AXI_CTRL_ACLK : in std_logic; S_AXI_CTRL_ARESETN : in std_logic; S_AXI_CTRL_AWADDR : in std_logic_vector((C_S_AXI_CTRL_ADDR_WIDTH-1) downto 0); S_AXI_CTRL_AWVALID : in std_logic; S_AXI_CTRL_AWREADY : out std_logic; S_AXI_CTRL_WDATA : in std_logic_vector((C_S_AXI_CTRL_DATA_WIDTH-1) downto 0); S_AXI_CTRL_WSTRB : in std_logic_vector(((C_S_AXI_CTRL_DATA_WIDTH/8)-1) downto 0); S_AXI_CTRL_WVALID : in std_logic; S_AXI_CTRL_WREADY : out std_logic; S_AXI_CTRL_BRESP : out std_logic_vector(1 downto 0); S_AXI_CTRL_BVALID : out std_logic; S_AXI_CTRL_BREADY : in std_logic; S_AXI_CTRL_ARADDR : in std_logic_vector((C_S_AXI_CTRL_ADDR_WIDTH-1) downto 0); S_AXI_CTRL_ARVALID : in std_logic; S_AXI_CTRL_ARREADY : out std_logic; S_AXI_CTRL_RDATA : out std_logic_vector((C_S_AXI_CTRL_DATA_WIDTH-1) downto 0); S_AXI_CTRL_RRESP : out std_logic_vector(1 downto 0); S_AXI_CTRL_RVALID : out std_logic; S_AXI_CTRL_RREADY : in std_logic ); end component; begin dlmb_cntlr : lmb_bram_if_cntlr generic map ( C_BASEADDR => X"00000000", C_HIGHADDR => X"00003FFF", C_FAMILY => "virtex5", C_MASK => X"80000000", C_MASK1 => X"00800000", C_MASK2 => X"00800000", C_MASK3 => X"00800000", C_LMB_AWIDTH => 32, C_LMB_DWIDTH => 32, C_ECC => 0, C_INTERCONNECT => 0, C_FAULT_INJECT => 0, C_CE_FAILING_REGISTERS => 0, C_UE_FAILING_REGISTERS => 0, C_ECC_STATUS_REGISTERS => 0, C_ECC_ONOFF_REGISTER => 0, C_ECC_ONOFF_RESET_VALUE => 1, C_CE_COUNTER_WIDTH => 0, C_WRITE_ACCESS => 2, C_NUM_LMB => 1, C_SPLB_CTRL_BASEADDR => X"FFFFFFFF", C_SPLB_CTRL_HIGHADDR => X"00000000", C_SPLB_CTRL_AWIDTH => 32, C_SPLB_CTRL_DWIDTH => 32, C_SPLB_CTRL_P2P => 0, C_SPLB_CTRL_MID_WIDTH => 1, C_SPLB_CTRL_NUM_MASTERS => 1, C_SPLB_CTRL_SUPPORT_BURSTS => 0, C_SPLB_CTRL_NATIVE_DWIDTH => 32, C_S_AXI_CTRL_BASEADDR => X"FFFFFFFF", C_S_AXI_CTRL_HIGHADDR => X"00000000", C_S_AXI_CTRL_ADDR_WIDTH => 32, C_S_AXI_CTRL_DATA_WIDTH => 32 ) port map ( LMB_Clk => LMB_Clk, LMB_Rst => LMB_Rst, LMB_ABus => LMB_ABus, LMB_WriteDBus => LMB_WriteDBus, LMB_AddrStrobe => LMB_AddrStrobe, LMB_ReadStrobe => LMB_ReadStrobe, LMB_WriteStrobe => LMB_WriteStrobe, LMB_BE => LMB_BE, Sl_DBus => Sl_DBus, Sl_Ready => Sl_Ready, Sl_Wait => Sl_Wait, Sl_UE => Sl_UE, Sl_CE => Sl_CE, LMB1_ABus => LMB1_ABus, LMB1_WriteDBus => LMB1_WriteDBus, LMB1_AddrStrobe => LMB1_AddrStrobe, LMB1_ReadStrobe => LMB1_ReadStrobe, LMB1_WriteStrobe => LMB1_WriteStrobe, LMB1_BE => LMB1_BE, Sl1_DBus => Sl1_DBus, Sl1_Ready => Sl1_Ready, Sl1_Wait => Sl1_Wait, Sl1_UE => Sl1_UE, Sl1_CE => Sl1_CE, LMB2_ABus => LMB2_ABus, LMB2_WriteDBus => LMB2_WriteDBus, LMB2_AddrStrobe => LMB2_AddrStrobe, LMB2_ReadStrobe => LMB2_ReadStrobe, LMB2_WriteStrobe => LMB2_WriteStrobe, LMB2_BE => LMB2_BE, Sl2_DBus => Sl2_DBus, Sl2_Ready => Sl2_Ready, Sl2_Wait => Sl2_Wait, Sl2_UE => Sl2_UE, Sl2_CE => Sl2_CE, LMB3_ABus => LMB3_ABus, LMB3_WriteDBus => LMB3_WriteDBus, LMB3_AddrStrobe => LMB3_AddrStrobe, LMB3_ReadStrobe => LMB3_ReadStrobe, LMB3_WriteStrobe => LMB3_WriteStrobe, LMB3_BE => LMB3_BE, Sl3_DBus => Sl3_DBus, Sl3_Ready => Sl3_Ready, Sl3_Wait => Sl3_Wait, Sl3_UE => Sl3_UE, Sl3_CE => Sl3_CE, BRAM_Rst_A => BRAM_Rst_A, BRAM_Clk_A => BRAM_Clk_A, BRAM_EN_A => BRAM_EN_A, BRAM_WEN_A => BRAM_WEN_A, BRAM_Addr_A => BRAM_Addr_A, BRAM_Din_A => BRAM_Din_A, BRAM_Dout_A => BRAM_Dout_A, Interrupt => Interrupt, UE => UE, CE => CE, SPLB_CTRL_PLB_ABus => SPLB_CTRL_PLB_ABus, SPLB_CTRL_PLB_PAValid => SPLB_CTRL_PLB_PAValid, SPLB_CTRL_PLB_masterID => SPLB_CTRL_PLB_masterID, SPLB_CTRL_PLB_RNW => SPLB_CTRL_PLB_RNW, SPLB_CTRL_PLB_BE => SPLB_CTRL_PLB_BE, SPLB_CTRL_PLB_size => SPLB_CTRL_PLB_size, SPLB_CTRL_PLB_type => SPLB_CTRL_PLB_type, SPLB_CTRL_PLB_wrDBus => SPLB_CTRL_PLB_wrDBus, SPLB_CTRL_Sl_addrAck => SPLB_CTRL_Sl_addrAck, SPLB_CTRL_Sl_SSize => SPLB_CTRL_Sl_SSize, SPLB_CTRL_Sl_wait => SPLB_CTRL_Sl_wait, SPLB_CTRL_Sl_rearbitrate => SPLB_CTRL_Sl_rearbitrate, SPLB_CTRL_Sl_wrDAck => SPLB_CTRL_Sl_wrDAck, SPLB_CTRL_Sl_wrComp => SPLB_CTRL_Sl_wrComp, SPLB_CTRL_Sl_rdDBus => SPLB_CTRL_Sl_rdDBus, SPLB_CTRL_Sl_rdDAck => SPLB_CTRL_Sl_rdDAck, SPLB_CTRL_Sl_rdComp => SPLB_CTRL_Sl_rdComp, SPLB_CTRL_Sl_MBusy => SPLB_CTRL_Sl_MBusy, SPLB_CTRL_Sl_MWrErr => SPLB_CTRL_Sl_MWrErr, SPLB_CTRL_Sl_MRdErr => SPLB_CTRL_Sl_MRdErr, SPLB_CTRL_PLB_UABus => SPLB_CTRL_PLB_UABus, SPLB_CTRL_PLB_SAValid => SPLB_CTRL_PLB_SAValid, SPLB_CTRL_PLB_rdPrim => SPLB_CTRL_PLB_rdPrim, SPLB_CTRL_PLB_wrPrim => SPLB_CTRL_PLB_wrPrim, SPLB_CTRL_PLB_abort => SPLB_CTRL_PLB_abort, SPLB_CTRL_PLB_busLock => SPLB_CTRL_PLB_busLock, SPLB_CTRL_PLB_MSize => SPLB_CTRL_PLB_MSize, SPLB_CTRL_PLB_lockErr => SPLB_CTRL_PLB_lockErr, SPLB_CTRL_PLB_wrBurst => SPLB_CTRL_PLB_wrBurst, SPLB_CTRL_PLB_rdBurst => SPLB_CTRL_PLB_rdBurst, SPLB_CTRL_PLB_wrPendReq => SPLB_CTRL_PLB_wrPendReq, SPLB_CTRL_PLB_rdPendReq => SPLB_CTRL_PLB_rdPendReq, SPLB_CTRL_PLB_wrPendPri => SPLB_CTRL_PLB_wrPendPri, SPLB_CTRL_PLB_rdPendPri => SPLB_CTRL_PLB_rdPendPri, SPLB_CTRL_PLB_reqPri => SPLB_CTRL_PLB_reqPri, SPLB_CTRL_PLB_TAttribute => SPLB_CTRL_PLB_TAttribute, SPLB_CTRL_Sl_wrBTerm => SPLB_CTRL_Sl_wrBTerm, SPLB_CTRL_Sl_rdWdAddr => SPLB_CTRL_Sl_rdWdAddr, SPLB_CTRL_Sl_rdBTerm => SPLB_CTRL_Sl_rdBTerm, SPLB_CTRL_Sl_MIRQ => SPLB_CTRL_Sl_MIRQ, S_AXI_CTRL_ACLK => S_AXI_CTRL_ACLK, S_AXI_CTRL_ARESETN => S_AXI_CTRL_ARESETN, S_AXI_CTRL_AWADDR => S_AXI_CTRL_AWADDR, S_AXI_CTRL_AWVALID => S_AXI_CTRL_AWVALID, S_AXI_CTRL_AWREADY => S_AXI_CTRL_AWREADY, S_AXI_CTRL_WDATA => S_AXI_CTRL_WDATA, S_AXI_CTRL_WSTRB => S_AXI_CTRL_WSTRB, S_AXI_CTRL_WVALID => S_AXI_CTRL_WVALID, S_AXI_CTRL_WREADY => S_AXI_CTRL_WREADY, S_AXI_CTRL_BRESP => S_AXI_CTRL_BRESP, S_AXI_CTRL_BVALID => S_AXI_CTRL_BVALID, S_AXI_CTRL_BREADY => S_AXI_CTRL_BREADY, S_AXI_CTRL_ARADDR => S_AXI_CTRL_ARADDR, S_AXI_CTRL_ARVALID => S_AXI_CTRL_ARVALID, S_AXI_CTRL_ARREADY => S_AXI_CTRL_ARREADY, S_AXI_CTRL_RDATA => S_AXI_CTRL_RDATA, S_AXI_CTRL_RRESP => S_AXI_CTRL_RRESP, S_AXI_CTRL_RVALID => S_AXI_CTRL_RVALID, S_AXI_CTRL_RREADY => S_AXI_CTRL_RREADY ); end architecture STRUCTURE;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2014, Aeroflex Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------- -- Entity: gracectrl -- File: gracectrl.vhd -- Author: Jan Andersson - Gaisler Research AB -- Contact: support@gaisler.com -- Description: Provides a GRLIB AMBA AHB slave interface to Xilinx System ACE ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; library grlib, gaisler; use grlib.amba.all; use grlib.devices.all; use grlib.stdlib.all; use gaisler.misc.all; entity gracectrl is generic ( hindex : integer := 0; -- AHB slave index hirq : integer := 0; -- Interrupt line haddr : integer := 16#000#; -- Base address hmask : integer := 16#fff#; -- Area mask split : integer range 0 to 1 := 0; -- Enable AMBA SPLIT support swap : integer range 0 to 1 := 0; oepol : integer range 0 to 1 := 0; -- Output enable polarity mode : integer range 0 to 2 := 0 -- 0: 16-bit mode only -- 1: 8-bit mode only -- 2: 8-bit, emulate 16-bit ); port ( rstn : in std_ulogic; clk : in std_ulogic; -- System (AMBA) clock clkace : in std_ulogic; -- System ACE clock ahbsi : in ahb_slv_in_type; ahbso : out ahb_slv_out_type; acei : in gracectrl_in_type; aceo : out gracectrl_out_type ); end gracectrl; architecture rtl of gracectrl is ----------------------------------------------------------------------------- -- Constants ----------------------------------------------------------------------------- constant REVISION : amba_version_type := 0; constant HCONFIG : ahb_config_type := ( 0 => ahb_device_reg(VENDOR_GAISLER, GAISLER_GRACECTRL, 0, REVISION, hirq), -- 1 => conv_std_logic_vector(swap*4 + mode, 32), 4 => ahb_iobar(haddr, hmask), others => zero32); constant OUTPUT : std_ulogic := conv_std_logic(oepol = 1); constant INPUT : std_ulogic := not conv_std_logic(oepol = 1); constant ACEDW : integer := 16-8*(mode mod 2); ----------------------------------------------------------------------------- -- Functions ----------------------------------------------------------------------------- -- purpose: swaps a hword if 'swap' is non-zero and mode is zero, -- otherwise just propagate data function condhswap (d : std_logic_vector) return std_logic_vector is variable dx : std_logic_vector(15 downto 0); begin -- hswap dx(ACEDW-1 downto 0) := d; if swap /= 0 and mode = 0 then return dx(7 downto 0) & dx(15 downto 8); end if; return dx; end condhswap; ----------------------------------------------------------------------------- -- Types ----------------------------------------------------------------------------- type sys_sync_type is record accdone : std_logic_vector(1 downto 0); irq : std_logic_vector(2 downto 0); end record; type sys_reg_type is record acc : std_ulogic; -- Perform access active : std_ulogic; -- Access active sync : sys_sync_type; -- AHB insplit : std_ulogic; -- SPLIT response issued unsplit : std_ulogic; -- SPLIT complete not issued irq : std_ulogic; -- Interrupt request hwrite : std_ulogic; hsel : std_ulogic; hmbsel : std_logic_vector(0 to 1); haddr : std_logic_vector(6 downto 0); hready : std_ulogic; wdata : std_logic_vector(ACEDW-1 downto 0); hresp : std_logic_vector(1 downto 0); splmst : std_logic_vector(log2(NAHBMST)-1 downto 0); -- SPLIT:ed master hsplit : std_logic_vector(NAHBMST-1 downto 0); -- Other SPLIT:ed masters ahbcancel : std_ulogic; -- Locked access cancels ongoing SPLIT -- response end record; type ace_state_type is (idle, en, rd, done); type ace_sync_type is record acc : std_logic_vector(1 downto 0); rstn : std_logic_vector(1 downto 0); hwrite : std_logic_vector(1 downto 0); dummy : std_logic_vector(1 downto 0); end record; type ace_reg_type is record state : ace_state_type; sync : ace_sync_type; accdone : std_ulogic; rdata : std_logic_vector(ACEDW-1 downto 0); edone : std_ulogic; aceo : gracectrl_out_type; end record; ----------------------------------------------------------------------------- -- Signals ----------------------------------------------------------------------------- signal r, rin : sys_reg_type; signal s, sin : ace_reg_type; begin -- rtl ----------------------------------------------------------------------------- -- System clock domain ----------------------------------------------------------------------------- combsys: process (r, s, rstn, ahbsi, acei.irq) variable v : sys_reg_type; variable irq : std_logic_vector((NAHBIRQ-1) downto 0); variable hsplit : std_logic_vector(NAHBMST-1 downto 0); variable hwdata : std_logic_vector(31 downto 0); begin -- process comb v := r; v.irq := '0'; irq := (others => '0'); irq(hirq) := r.irq; v.hresp := HRESP_OKAY; v.hready := '1'; hsplit := (others => '0'); hwdata := ahbreadword(ahbsi.hwdata, r.haddr(4 downto 2)); -- Sync v.sync.accdone := r.sync.accdone(0) & s.accdone; v.sync.irq := r.sync.irq(1 downto 0) & acei.irq; -- AHB communication if ahbsi.hready = '1' then if (ahbsi.hsel(hindex) and ahbsi.htrans(1)) = '1' then v.hmbsel := ahbsi.hmbsel(r.hmbsel'range); if split = 0 or (not (r.active or r.acc) or ahbsi.hmastlock) = '1' then v.hready := '0'; v.hwrite := ahbsi.hwrite; v.haddr := ahbsi.haddr(6 downto 0); v.hsel := '1'; if r.insplit = '0' then v.acc := '1'; end if; if split /= 0 then if ahbsi.hmastlock = '0' then v.hresp := HRESP_SPLIT; v.splmst := ahbsi.hmaster; v.unsplit := '1'; else v.ahbcancel := r.insplit; end if; v.insplit := not ahbsi.hmastlock; end if; else -- Core is busy, transfer is not locked respond with SPLIT v.hready := '0'; if split /= 0 then v.hresp := HRESP_SPLIT; v.hsplit(conv_integer(ahbsi.hmaster)) := '1'; end if; end if; else v.hsel := '0'; end if; end if; if (r.hready = '0') then if (r.hresp = HRESP_OKAY) then v.hready := '0'; else v.hresp := r.hresp; end if; end if; if r.acc = '1' then -- Propagate data if r.active = '0' then if mode /= 1 then if r.haddr(1) = '0' then v.wdata := hwdata(ACEDW+15 downto 16); else v.wdata := hwdata(ACEDW-1 downto 0); end if; else case r.haddr(1 downto 0) is when "00" => v.wdata(7 downto 0) := hwdata(31 downto 24); when "01" => v.wdata(7 downto 0) := hwdata(23 downto 16); when "10" => v.wdata(7 downto 0) := hwdata(15 downto 8); when others => v.wdata(7 downto 0) := hwdata(7 downto 0); end case; end if; if mode = 2 then -- Override writes to busmode register if r.haddr(6 downto 1) = zero32(6 downto 1) then v.wdata := (others => '0'); -- Byte end if; end if; end if; -- Remove access signal when access is done if r.sync.accdone(1) = '1' then v.acc := '0'; end if; v.active := '1'; end if; -- AMBA response when access is complete if r.acc = '0' and r.sync.accdone(1) = '0' and r.active = '1' then if split /= 0 and r.unsplit = '1' then hsplit(conv_integer(r.splmst)) := '1'; v.unsplit := '0'; end if; if ((split = 0 or v.ahbcancel = '0') and (split = 0 or ahbsi.hmaster = r.splmst or r.insplit = '0') and (((ahbsi.hsel(hindex) and ahbsi.hready and ahbsi.htrans(1)) = '1') or ((split = 0 or r.insplit = '0') and r.hready = '0' and r.hresp = HRESP_OKAY))) then v.hresp := HRESP_OKAY; if split /= 0 then v.insplit := '0'; v.hsplit := r.hsplit; end if; v.hready := '1'; v.hsel := '0'; v.active := '0'; elsif split /= 0 and v.ahbcancel = '1' then v.acc := '1'; v.ahbcancel := '0'; end if; end if; -- Interrupt request, not filtered, pulsed if (not r.sync.irq(2) and r.sync.irq(1)) = '1' then v.irq := '1'; end if; -- Reset if rstn = '0' then v.acc := '0'; v.active := '0'; -- v.insplit := '0'; v.unsplit := '0'; v.hready := '1'; v.hwrite := '0'; v.hsel := '0'; v.hmbsel := (others => '0'); v.ahbcancel := '0'; end if; if split = 0 then v.insplit := '0'; v.unsplit := '0'; v.splmst := (others => '0'); v.hsplit := (others => '0'); v.ahbcancel := '0'; end if; -- Update registers rin <= v; -- AHB slave output ahbso.hready <= r.hready; ahbso.hresp <= r.hresp; ahbso.hrdata <= ahbdrivedata(s.rdata); -- Bad, but does not toggle much ahbso.hconfig <= HCONFIG; ahbso.hirq <= irq; ahbso.hindex <= hindex; ahbso.hsplit <= hsplit; end process combsys; regsys: process (clk) begin -- process reg if rising_edge(clk) then r <= rin; end if; end process regsys; ----------------------------------------------------------------------------- -- System ACE clock domain ----------------------------------------------------------------------------- combace: process (r, s, rstn, acei) variable v : ace_reg_type; begin -- process comb v := s; -- Synchronize inputs v.sync.acc := s.sync.acc(0) & r.acc; v.sync.rstn := s.sync.rstn(0) & rstn; v.sync.hwrite := s.sync.hwrite(0) & r.hwrite; if mode = 2 then -- Fake reads from BUSMODE register? v.sync.dummy := s.sync.dummy(0) & not orv(r.haddr(6 downto 1)); else v.sync.dummy := (others => '0'); end if; case s.state is when idle => v.aceo.addr := r.haddr(6 downto 0); if mode = 2 then v.aceo.do(7 downto 0) := r.wdata(7 downto 0); else v.aceo.do(r.wdata'range) := condhswap(r.wdata); end if; if s.sync.acc(1) = '1' then v.aceo.cen := '0'; v.aceo.doen := INPUT xor r.hwrite; v.state := en; end if; if mode = 2 then v.edone := '0'; end if; when en => v.aceo.wen := not r.hwrite; if s.sync.hwrite(1) = '1' then v.state := done; else v.state := rd; end if; when rd => v.aceo.oen := '0'; v.state := done; when done => v.aceo.oen := '1'; v.aceo.wen := '1'; if mode = 2 and s.edone = '0' then -- Keep 16-bit address map v.aceo.addr(0) := '1'; v.aceo.do(7 downto 0) := r.wdata(ACEDW-1 downto ACEDW-8); v.rdata(7 downto 0) := acei.di(7 downto 0); v.edone := '1'; v.state := en; else v.aceo.cen := '1'; if s.accdone = '0' then if mode = 2 then v.rdata(ACEDW-1 downto ACEDW-8) := acei.di(7 downto 0); if s.sync.dummy(1) = '1' then -- Fake read v.rdata := (others => '0'); v.rdata(0) := '1'; end if; else v.rdata := condhswap(acei.di)(s.rdata'range); end if; v.accdone := '1'; else v.aceo.doen := INPUT; end if; if s.sync.acc(1) = '0' then v.state := idle; v.accdone := '0'; end if; end if; end case; -- Reset if s.sync.rstn(1) = '0' then v.state := idle; v.accdone := '0'; v.aceo.cen := '1'; v.aceo.wen := '1'; v.aceo.oen := '1'; v.aceo.doen := INPUT; end if; if mode = 1 then v.aceo.do(15 downto 8) := (others => '0'); end if; if mode /= 2 then v.edone := '0'; end if; -- Update registers sin <= v; -- Assign outputs to System ACE aceo <= s.aceo; end process combace; regace: process (clkace) begin -- process reg if rising_edge(clkace) then s <= sin; end if; end process regace; -- Boot message -- pragma translate_off bootmsg : report_version generic map ( "gracectrl" & tost(hindex) & ": System ACE I/F Controller, rev " & tost(REVISION) & ", irq " & tost(hirq)); -- pragma translate_on end rtl;
library verilog; use verilog.vl_types.all; entity F2DSS_ACE_PPE_RDMUX is port( RAM_RD_B_apbrd_pre: in vl_logic; RAM_DO_B : in vl_logic_vector(31 downto 0); ADC0_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC0_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA3 : in vl_logic_vector(31 downto 0); ADC1_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC1_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA3 : in vl_logic_vector(31 downto 0); ADC2_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC2_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA3 : in vl_logic_vector(31 downto 0); PPE_CTRL : in vl_logic_vector(31 downto 0); PPE_PC_ETC : in vl_logic_vector(31 downto 0); PPE_SCRATCH : in vl_logic_vector(31 downto 0); PPE_SF : in vl_logic_vector(31 downto 0); ALU_CTRL : in vl_logic_vector(31 downto 0); ALU_STATUS : in vl_logic_vector(31 downto 0); ALU_A : in vl_logic_vector(31 downto 0); ALU_B : in vl_logic_vector(31 downto 0); ALU_C : in vl_logic_vector(31 downto 0); ALU_D : in vl_logic_vector(15 downto 0); ALU_E : in vl_logic_vector(15 downto 0); PPE_FPTR : in vl_logic_vector(31 downto 0); PPE_FLAGS0 : in vl_logic_vector(31 downto 0); PPE_FLAGS1 : in vl_logic_vector(31 downto 0); PPE_FLAGS2 : in vl_logic_vector(31 downto 0); PPE_FLAGS3 : in vl_logic_vector(31 downto 0); PPE_SFFLAGS : in vl_logic_vector(31 downto 0); PADDR : in vl_logic_vector(12 downto 0); PRDATA_PPE : out vl_logic_vector(31 downto 0) ); end F2DSS_ACE_PPE_RDMUX;
library verilog; use verilog.vl_types.all; entity F2DSS_ACE_PPE_RDMUX is port( RAM_RD_B_apbrd_pre: in vl_logic; RAM_DO_B : in vl_logic_vector(31 downto 0); ADC0_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC0_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA3 : in vl_logic_vector(31 downto 0); ADC1_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC1_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA3 : in vl_logic_vector(31 downto 0); ADC2_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC2_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA3 : in vl_logic_vector(31 downto 0); PPE_CTRL : in vl_logic_vector(31 downto 0); PPE_PC_ETC : in vl_logic_vector(31 downto 0); PPE_SCRATCH : in vl_logic_vector(31 downto 0); PPE_SF : in vl_logic_vector(31 downto 0); ALU_CTRL : in vl_logic_vector(31 downto 0); ALU_STATUS : in vl_logic_vector(31 downto 0); ALU_A : in vl_logic_vector(31 downto 0); ALU_B : in vl_logic_vector(31 downto 0); ALU_C : in vl_logic_vector(31 downto 0); ALU_D : in vl_logic_vector(15 downto 0); ALU_E : in vl_logic_vector(15 downto 0); PPE_FPTR : in vl_logic_vector(31 downto 0); PPE_FLAGS0 : in vl_logic_vector(31 downto 0); PPE_FLAGS1 : in vl_logic_vector(31 downto 0); PPE_FLAGS2 : in vl_logic_vector(31 downto 0); PPE_FLAGS3 : in vl_logic_vector(31 downto 0); PPE_SFFLAGS : in vl_logic_vector(31 downto 0); PADDR : in vl_logic_vector(12 downto 0); PRDATA_PPE : out vl_logic_vector(31 downto 0) ); end F2DSS_ACE_PPE_RDMUX;
library verilog; use verilog.vl_types.all; entity F2DSS_ACE_PPE_RDMUX is port( RAM_RD_B_apbrd_pre: in vl_logic; RAM_DO_B : in vl_logic_vector(31 downto 0); ADC0_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC0_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC0_FIFO_DATA3 : in vl_logic_vector(31 downto 0); ADC1_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC1_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC1_FIFO_DATA3 : in vl_logic_vector(31 downto 0); ADC2_FIFO_CTRL : in vl_logic_vector(31 downto 0); ADC2_FIFO_STATUS: in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA_PEEK: in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA0 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA1 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA2 : in vl_logic_vector(31 downto 0); ADC2_FIFO_DATA3 : in vl_logic_vector(31 downto 0); PPE_CTRL : in vl_logic_vector(31 downto 0); PPE_PC_ETC : in vl_logic_vector(31 downto 0); PPE_SCRATCH : in vl_logic_vector(31 downto 0); PPE_SF : in vl_logic_vector(31 downto 0); ALU_CTRL : in vl_logic_vector(31 downto 0); ALU_STATUS : in vl_logic_vector(31 downto 0); ALU_A : in vl_logic_vector(31 downto 0); ALU_B : in vl_logic_vector(31 downto 0); ALU_C : in vl_logic_vector(31 downto 0); ALU_D : in vl_logic_vector(15 downto 0); ALU_E : in vl_logic_vector(15 downto 0); PPE_FPTR : in vl_logic_vector(31 downto 0); PPE_FLAGS0 : in vl_logic_vector(31 downto 0); PPE_FLAGS1 : in vl_logic_vector(31 downto 0); PPE_FLAGS2 : in vl_logic_vector(31 downto 0); PPE_FLAGS3 : in vl_logic_vector(31 downto 0); PPE_SFFLAGS : in vl_logic_vector(31 downto 0); PADDR : in vl_logic_vector(12 downto 0); PRDATA_PPE : out vl_logic_vector(31 downto 0) ); end F2DSS_ACE_PPE_RDMUX;
architecture rtl of fifo is begin my_signal <= '1' when input = "00" else my_signal2 or my_sig3 when input = "01" else my_sig4 and my_sig5 when input = "10" else '0'; my_signal <= '1' when input = "0000" else my_signal2 or my_sig3 when input = "0100" and input = "1100" else my_sig4 when input = "0010" else '0'; my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else '0' when input(3 downto 0) = "0010" else 'Z'; my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else '0' when input(3 downto 0) = "0010" else 'Z'; my_signal <= '1' when a = "0000" and func1(345) or b = "1000" and func2(567) and c = "00" else sig1 when a = "1000" and func2(560) and b = "0010" else '0'; my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else my_signal when input(3 downto 0) = "0010" else 'Z'; -- Testing no code after assignment my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else my_signal when input(3 downto 0) = "0010" else 'Z'; my_signal <= (others => '0') when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else my_signal when input(3 downto 0) = "0010" else 'Z'; end architecture rtl;
-------------------------------------------------------------------------------- -- -- FIFO Generator Core Demo Testbench -- -------------------------------------------------------------------------------- -- -- (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -------------------------------------------------------------------------------- -- -- Filename: fg_tb_synth.vhd -- -- Description: -- This is the demo testbench for fifo_generator core. -- -------------------------------------------------------------------------------- -- Library Declarations -------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.STD_LOGIC_1164.ALL; USE ieee.STD_LOGIC_unsigned.ALL; USE IEEE.STD_LOGIC_arith.ALL; USE ieee.numeric_std.ALL; USE ieee.STD_LOGIC_misc.ALL; LIBRARY std; USE std.textio.ALL; LIBRARY unisim; USE unisim.vcomponents.ALL; LIBRARY work; USE work.fg_tb_pkg.ALL; -------------------------------------------------------------------------------- -- Entity Declaration -------------------------------------------------------------------------------- ENTITY fg_tb_synth IS GENERIC( FREEZEON_ERROR : INTEGER := 0; TB_STOP_CNT : INTEGER := 0; TB_SEED : INTEGER := 1 ); PORT( CLK : IN STD_LOGIC; RESET : IN STD_LOGIC; SIM_DONE : OUT STD_LOGIC; STATUS : OUT STD_LOGIC_VECTOR(7 DOWNTO 0) ); END ENTITY; ARCHITECTURE simulation_arch OF fg_tb_synth IS -- FIFO interface signal declarations SIGNAL clk_i : STD_LOGIC; SIGNAL srst : STD_LOGIC; SIGNAL wr_en : STD_LOGIC; SIGNAL rd_en : STD_LOGIC; SIGNAL din : STD_LOGIC_VECTOR(96-1 DOWNTO 0); SIGNAL dout : STD_LOGIC_VECTOR(96-1 DOWNTO 0); SIGNAL full : STD_LOGIC; SIGNAL empty : STD_LOGIC; -- TB Signals SIGNAL wr_data : STD_LOGIC_VECTOR(96-1 DOWNTO 0); SIGNAL dout_i : STD_LOGIC_VECTOR(96-1 DOWNTO 0); SIGNAL wr_en_i : STD_LOGIC := '0'; SIGNAL rd_en_i : STD_LOGIC := '0'; SIGNAL full_i : STD_LOGIC := '0'; SIGNAL empty_i : STD_LOGIC := '0'; SIGNAL almost_full_i : STD_LOGIC := '0'; SIGNAL almost_empty_i : STD_LOGIC := '0'; SIGNAL prc_we_i : STD_LOGIC := '0'; SIGNAL prc_re_i : STD_LOGIC := '0'; SIGNAL dout_chk_i : STD_LOGIC := '0'; SIGNAL rst_int_rd : STD_LOGIC := '0'; SIGNAL rst_int_wr : STD_LOGIC := '0'; SIGNAL rst_gen_rd : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0'); SIGNAL rst_s_wr3 : STD_LOGIC := '0'; SIGNAL rst_s_rd : STD_LOGIC := '0'; SIGNAL reset_en : STD_LOGIC := '0'; SIGNAL rst_async_rd1 : STD_LOGIC := '0'; SIGNAL rst_async_rd2 : STD_LOGIC := '0'; SIGNAL rst_async_rd3 : STD_LOGIC := '0'; SIGNAL rst_sync_rd1 : STD_LOGIC := '0'; SIGNAL rst_sync_rd2 : STD_LOGIC := '0'; SIGNAL rst_sync_rd3 : STD_LOGIC := '0'; BEGIN ---- Reset generation logic ----- rst_int_wr <= rst_async_rd3 OR rst_s_rd; rst_int_rd <= rst_async_rd3 OR rst_s_rd; --Testbench reset synchronization PROCESS(clk_i,RESET) BEGIN IF(RESET = '1') THEN rst_async_rd1 <= '1'; rst_async_rd2 <= '1'; rst_async_rd3 <= '1'; ELSIF(clk_i'event AND clk_i='1') THEN rst_async_rd1 <= RESET; rst_async_rd2 <= rst_async_rd1; rst_async_rd3 <= rst_async_rd2; END IF; END PROCESS; --Synchronous reset generation for FIFO core PROCESS(clk_i) BEGIN IF(clk_i'event AND clk_i='1') THEN rst_sync_rd1 <= RESET; rst_sync_rd2 <= rst_sync_rd1; rst_sync_rd3 <= rst_sync_rd2; END IF; END PROCESS; --Soft reset for core and testbench PROCESS(clk_i) BEGIN IF(clk_i'event AND clk_i='1') THEN rst_gen_rd <= rst_gen_rd + "1"; IF(reset_en = '1' AND AND_REDUCE(rst_gen_rd) = '1') THEN rst_s_rd <= '1'; assert false report "Reset applied..Memory Collision checks are not valid" severity note; ELSE IF(AND_REDUCE(rst_gen_rd) = '1' AND rst_s_rd = '1') THEN rst_s_rd <= '0'; assert false report "Reset removed..Memory Collision checks are valid" severity note; END IF; END IF; END IF; END PROCESS; ------------------ ---- Clock buffers for testbench ---- clk_buf: bufg PORT map( i => CLK, o => clk_i ); ------------------ srst <= rst_sync_rd3 OR rst_s_rd AFTER 12 ns; din <= wr_data; dout_i <= dout; wr_en <= wr_en_i; rd_en <= rd_en_i; full_i <= full; empty_i <= empty; fg_dg_nv: fg_tb_dgen GENERIC MAP ( C_DIN_WIDTH => 96, C_DOUT_WIDTH => 96, TB_SEED => TB_SEED, C_CH_TYPE => 0 ) PORT MAP ( -- Write Port RESET => rst_int_wr, WR_CLK => clk_i, PRC_WR_EN => prc_we_i, FULL => full_i, WR_EN => wr_en_i, WR_DATA => wr_data ); fg_dv_nv: fg_tb_dverif GENERIC MAP ( C_DOUT_WIDTH => 96, C_DIN_WIDTH => 96, C_USE_EMBEDDED_REG => 0, TB_SEED => TB_SEED, C_CH_TYPE => 0 ) PORT MAP( RESET => rst_int_rd, RD_CLK => clk_i, PRC_RD_EN => prc_re_i, RD_EN => rd_en_i, EMPTY => empty_i, DATA_OUT => dout_i, DOUT_CHK => dout_chk_i ); fg_pc_nv: fg_tb_pctrl GENERIC MAP ( AXI_CHANNEL => "Native", C_APPLICATION_TYPE => 0, C_DOUT_WIDTH => 96, C_DIN_WIDTH => 96, C_WR_PNTR_WIDTH => 9, C_RD_PNTR_WIDTH => 9, C_CH_TYPE => 0, FREEZEON_ERROR => FREEZEON_ERROR, TB_SEED => TB_SEED, TB_STOP_CNT => TB_STOP_CNT ) PORT MAP( RESET_WR => rst_int_wr, RESET_RD => rst_int_rd, RESET_EN => reset_en, WR_CLK => clk_i, RD_CLK => clk_i, PRC_WR_EN => prc_we_i, PRC_RD_EN => prc_re_i, FULL => full_i, ALMOST_FULL => almost_full_i, ALMOST_EMPTY => almost_empty_i, DOUT_CHK => dout_chk_i, EMPTY => empty_i, DATA_IN => wr_data, DATA_OUT => dout, SIM_DONE => SIM_DONE, STATUS => STATUS ); fg_inst : fifo_96x512_top PORT MAP ( CLK => clk_i, SRST => srst, WR_EN => wr_en, RD_EN => rd_en, DIN => din, DOUT => dout, FULL => full, EMPTY => empty); END ARCHITECTURE;
-- ------------------------------------------------------------- -- -- File Name: hdlsrc\Program_Counter.vhd -- Created: 2014-03-05 16:19:14 -- -- Generated by MATLAB 7.12 and Simulink HDL Coder 2.1 -- -- ------------------------------------------------------------- -- ------------------------------------------------------------- -- -- Module: Program_Counter -- Source Path: hdlcodercpu_eml/CPU_Subsystem_8_bit/Program Counter -- Hierarchy Level: 1 -- -- ------------------------------------------------------------- LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; USE IEEE.numeric_std.ALL; ENTITY Program_Counter IS PORT( clk : IN std_logic; reset : IN std_logic; enb : IN std_logic; func : IN std_logic_vector(1 DOWNTO 0); -- ufix2 addr_in : IN std_logic_vector(7 DOWNTO 0); -- uint8 addr_out : OUT std_logic_vector(7 DOWNTO 0) -- uint8 ); END Program_Counter; ARCHITECTURE rtl OF Program_Counter IS -- Signals SIGNAL func_unsigned : unsigned(1 DOWNTO 0); -- ufix2 SIGNAL addr_in_unsigned : unsigned(7 DOWNTO 0); -- uint8 SIGNAL addr_out_tmp : unsigned(7 DOWNTO 0); -- uint8 SIGNAL PC_value : unsigned(7 DOWNTO 0); -- ufix8 SIGNAL PC_value_next : unsigned(7 DOWNTO 0); -- ufix8 BEGIN func_unsigned <= unsigned(func); addr_in_unsigned <= unsigned(addr_in); Program_Counter_1_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN PC_value <= to_unsigned(0, 8); ELSIF clk'EVENT AND clk = '1' THEN IF enb = '1' THEN PC_value <= PC_value_next; END IF; END IF; END PROCESS Program_Counter_1_process; Program_Counter_1_output : PROCESS (func_unsigned, addr_in_unsigned, PC_value) BEGIN PC_value_next <= PC_value; --MATLAB Function 'CPU_Subsystem_8_bit/Program Counter': '<S10>:1' -- Program Counter -- func = 0 => reset PC -- func = 1 => load PC -- func = 2 => increment PC -- HDL specific fimath --'<S10>:1:20' addr_out_tmp <= PC_value; CASE func_unsigned IS WHEN "00" => -- reset --'<S10>:1:25' PC_value_next <= to_unsigned(0, 8); WHEN "01" => -- store into PC --'<S10>:1:28' PC_value_next <= addr_in_unsigned; WHEN "10" => -- increment PC --'<S10>:1:31' PC_value_next <= PC_value + 1; WHEN OTHERS => NULL; END CASE; END PROCESS Program_Counter_1_output; addr_out <= std_logic_vector(addr_out_tmp); END rtl;
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity AXIinterfacefor65816_v1_0 is generic ( -- Users to add parameters here -- User parameters ends -- Do not modify the parameters beyond this line -- Parameters of Axi Slave Bus Interface S00_AXI C_S00_AXI_DATA_WIDTH : integer := 32; C_S00_AXI_ADDR_WIDTH : integer := 7 ); port ( -- Users to add ports here clk : in std_logic; tru_clk: in std_logic; reset_65816_module : in std_logic; -- User ports ends -- Do not modify the ports beyond this line -- Ports of Axi Slave Bus Interface S00_AXI s00_axi_aclk : in std_logic; s00_axi_aresetn : in std_logic; s00_axi_awaddr : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0); s00_axi_awprot : in std_logic_vector(2 downto 0); s00_axi_awvalid : in std_logic; s00_axi_awready : out std_logic; s00_axi_wdata : in std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0); s00_axi_wstrb : in std_logic_vector((C_S00_AXI_DATA_WIDTH/8)-1 downto 0); s00_axi_wvalid : in std_logic; s00_axi_wready : out std_logic; s00_axi_bresp : out std_logic_vector(1 downto 0); s00_axi_bvalid : out std_logic; s00_axi_bready : in std_logic; s00_axi_araddr : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0); s00_axi_arprot : in std_logic_vector(2 downto 0); s00_axi_arvalid : in std_logic; s00_axi_arready : out std_logic; s00_axi_rdata : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0); s00_axi_rresp : out std_logic_vector(1 downto 0); s00_axi_rvalid : out std_logic; s00_axi_rready : in std_logic ); end AXIinterfacefor65816_v1_0; architecture arch_imp of AXIinterfacefor65816_v1_0 is -- component declaration component AXIinterfacefor65816_v1_0_S00_AXI is generic ( C_S_AXI_DATA_WIDTH : integer := 32; C_S_AXI_ADDR_WIDTH : integer := 7 ); port ( clk : in std_logic; tru_clk: in std_logic; reset_65816_module : in std_logic; S_AXI_ACLK : in std_logic; S_AXI_ARESETN : in std_logic; S_AXI_AWADDR : in std_logic_vector(C_S_AXI_ADDR_WIDTH-1 downto 0); S_AXI_AWPROT : in std_logic_vector(2 downto 0); S_AXI_AWVALID : in std_logic; S_AXI_AWREADY : out std_logic; S_AXI_WDATA : in std_logic_vector(C_S_AXI_DATA_WIDTH-1 downto 0); S_AXI_WSTRB : in std_logic_vector((C_S_AXI_DATA_WIDTH/8)-1 downto 0); S_AXI_WVALID : in std_logic; S_AXI_WREADY : out std_logic; S_AXI_BRESP : out std_logic_vector(1 downto 0); S_AXI_BVALID : out std_logic; S_AXI_BREADY : in std_logic; S_AXI_ARADDR : in std_logic_vector(C_S_AXI_ADDR_WIDTH-1 downto 0); S_AXI_ARPROT : in std_logic_vector(2 downto 0); S_AXI_ARVALID : in std_logic; S_AXI_ARREADY : out std_logic; S_AXI_RDATA : out std_logic_vector(C_S_AXI_DATA_WIDTH-1 downto 0); S_AXI_RRESP : out std_logic_vector(1 downto 0); S_AXI_RVALID : out std_logic; S_AXI_RREADY : in std_logic ); end component AXIinterfacefor65816_v1_0_S00_AXI; begin -- Instantiation of Axi Bus Interface S00_AXI AXIinterfacefor65816_v1_0_S00_AXI_inst : AXIinterfacefor65816_v1_0_S00_AXI generic map ( C_S_AXI_DATA_WIDTH => C_S00_AXI_DATA_WIDTH, C_S_AXI_ADDR_WIDTH => C_S00_AXI_ADDR_WIDTH ) port map ( clk => clk, tru_clk => tru_clk, reset_65816_module => reset_65816_module, S_AXI_ACLK => s00_axi_aclk, S_AXI_ARESETN => s00_axi_aresetn, S_AXI_AWADDR => s00_axi_awaddr, S_AXI_AWPROT => s00_axi_awprot, S_AXI_AWVALID => s00_axi_awvalid, S_AXI_AWREADY => s00_axi_awready, S_AXI_WDATA => s00_axi_wdata, S_AXI_WSTRB => s00_axi_wstrb, S_AXI_WVALID => s00_axi_wvalid, S_AXI_WREADY => s00_axi_wready, S_AXI_BRESP => s00_axi_bresp, S_AXI_BVALID => s00_axi_bvalid, S_AXI_BREADY => s00_axi_bready, S_AXI_ARADDR => s00_axi_araddr, S_AXI_ARPROT => s00_axi_arprot, S_AXI_ARVALID => s00_axi_arvalid, S_AXI_ARREADY => s00_axi_arready, S_AXI_RDATA => s00_axi_rdata, S_AXI_RRESP => s00_axi_rresp, S_AXI_RVALID => s00_axi_rvalid, S_AXI_RREADY => s00_axi_rready ); -- Add user logic here -- User logic ends end arch_imp;
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity AXIinterfacefor65816_v1_0 is generic ( -- Users to add parameters here -- User parameters ends -- Do not modify the parameters beyond this line -- Parameters of Axi Slave Bus Interface S00_AXI C_S00_AXI_DATA_WIDTH : integer := 32; C_S00_AXI_ADDR_WIDTH : integer := 7 ); port ( -- Users to add ports here clk : in std_logic; tru_clk: in std_logic; reset_65816_module : in std_logic; -- User ports ends -- Do not modify the ports beyond this line -- Ports of Axi Slave Bus Interface S00_AXI s00_axi_aclk : in std_logic; s00_axi_aresetn : in std_logic; s00_axi_awaddr : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0); s00_axi_awprot : in std_logic_vector(2 downto 0); s00_axi_awvalid : in std_logic; s00_axi_awready : out std_logic; s00_axi_wdata : in std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0); s00_axi_wstrb : in std_logic_vector((C_S00_AXI_DATA_WIDTH/8)-1 downto 0); s00_axi_wvalid : in std_logic; s00_axi_wready : out std_logic; s00_axi_bresp : out std_logic_vector(1 downto 0); s00_axi_bvalid : out std_logic; s00_axi_bready : in std_logic; s00_axi_araddr : in std_logic_vector(C_S00_AXI_ADDR_WIDTH-1 downto 0); s00_axi_arprot : in std_logic_vector(2 downto 0); s00_axi_arvalid : in std_logic; s00_axi_arready : out std_logic; s00_axi_rdata : out std_logic_vector(C_S00_AXI_DATA_WIDTH-1 downto 0); s00_axi_rresp : out std_logic_vector(1 downto 0); s00_axi_rvalid : out std_logic; s00_axi_rready : in std_logic ); end AXIinterfacefor65816_v1_0; architecture arch_imp of AXIinterfacefor65816_v1_0 is -- component declaration component AXIinterfacefor65816_v1_0_S00_AXI is generic ( C_S_AXI_DATA_WIDTH : integer := 32; C_S_AXI_ADDR_WIDTH : integer := 7 ); port ( clk : in std_logic; tru_clk: in std_logic; reset_65816_module : in std_logic; S_AXI_ACLK : in std_logic; S_AXI_ARESETN : in std_logic; S_AXI_AWADDR : in std_logic_vector(C_S_AXI_ADDR_WIDTH-1 downto 0); S_AXI_AWPROT : in std_logic_vector(2 downto 0); S_AXI_AWVALID : in std_logic; S_AXI_AWREADY : out std_logic; S_AXI_WDATA : in std_logic_vector(C_S_AXI_DATA_WIDTH-1 downto 0); S_AXI_WSTRB : in std_logic_vector((C_S_AXI_DATA_WIDTH/8)-1 downto 0); S_AXI_WVALID : in std_logic; S_AXI_WREADY : out std_logic; S_AXI_BRESP : out std_logic_vector(1 downto 0); S_AXI_BVALID : out std_logic; S_AXI_BREADY : in std_logic; S_AXI_ARADDR : in std_logic_vector(C_S_AXI_ADDR_WIDTH-1 downto 0); S_AXI_ARPROT : in std_logic_vector(2 downto 0); S_AXI_ARVALID : in std_logic; S_AXI_ARREADY : out std_logic; S_AXI_RDATA : out std_logic_vector(C_S_AXI_DATA_WIDTH-1 downto 0); S_AXI_RRESP : out std_logic_vector(1 downto 0); S_AXI_RVALID : out std_logic; S_AXI_RREADY : in std_logic ); end component AXIinterfacefor65816_v1_0_S00_AXI; begin -- Instantiation of Axi Bus Interface S00_AXI AXIinterfacefor65816_v1_0_S00_AXI_inst : AXIinterfacefor65816_v1_0_S00_AXI generic map ( C_S_AXI_DATA_WIDTH => C_S00_AXI_DATA_WIDTH, C_S_AXI_ADDR_WIDTH => C_S00_AXI_ADDR_WIDTH ) port map ( clk => clk, tru_clk => tru_clk, reset_65816_module => reset_65816_module, S_AXI_ACLK => s00_axi_aclk, S_AXI_ARESETN => s00_axi_aresetn, S_AXI_AWADDR => s00_axi_awaddr, S_AXI_AWPROT => s00_axi_awprot, S_AXI_AWVALID => s00_axi_awvalid, S_AXI_AWREADY => s00_axi_awready, S_AXI_WDATA => s00_axi_wdata, S_AXI_WSTRB => s00_axi_wstrb, S_AXI_WVALID => s00_axi_wvalid, S_AXI_WREADY => s00_axi_wready, S_AXI_BRESP => s00_axi_bresp, S_AXI_BVALID => s00_axi_bvalid, S_AXI_BREADY => s00_axi_bready, S_AXI_ARADDR => s00_axi_araddr, S_AXI_ARPROT => s00_axi_arprot, S_AXI_ARVALID => s00_axi_arvalid, S_AXI_ARREADY => s00_axi_arready, S_AXI_RDATA => s00_axi_rdata, S_AXI_RRESP => s00_axi_rresp, S_AXI_RVALID => s00_axi_rvalid, S_AXI_RREADY => s00_axi_rready ); -- Add user logic here -- User logic ends end arch_imp;
-- (c) Copyright 1995-2017 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:ip:proc_sys_reset:5.0 -- IP Revision: 12 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; LIBRARY proc_sys_reset_v5_0_12; USE proc_sys_reset_v5_0_12.proc_sys_reset; ENTITY ip_design_rst_ps7_0_100M_0 IS PORT ( slowest_sync_clk : IN STD_LOGIC; ext_reset_in : IN STD_LOGIC; aux_reset_in : IN STD_LOGIC; mb_debug_sys_rst : IN STD_LOGIC; dcm_locked : IN STD_LOGIC; mb_reset : OUT STD_LOGIC; bus_struct_reset : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); peripheral_reset : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); interconnect_aresetn : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); peripheral_aresetn : OUT STD_LOGIC_VECTOR(0 DOWNTO 0) ); END ip_design_rst_ps7_0_100M_0; ARCHITECTURE ip_design_rst_ps7_0_100M_0_arch OF ip_design_rst_ps7_0_100M_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF ip_design_rst_ps7_0_100M_0_arch: ARCHITECTURE IS "yes"; COMPONENT proc_sys_reset IS GENERIC ( C_FAMILY : STRING; C_EXT_RST_WIDTH : INTEGER; C_AUX_RST_WIDTH : INTEGER; C_EXT_RESET_HIGH : STD_LOGIC; C_AUX_RESET_HIGH : STD_LOGIC; C_NUM_BUS_RST : INTEGER; C_NUM_PERP_RST : INTEGER; C_NUM_INTERCONNECT_ARESETN : INTEGER; C_NUM_PERP_ARESETN : INTEGER ); PORT ( slowest_sync_clk : IN STD_LOGIC; ext_reset_in : IN STD_LOGIC; aux_reset_in : IN STD_LOGIC; mb_debug_sys_rst : IN STD_LOGIC; dcm_locked : IN STD_LOGIC; mb_reset : OUT STD_LOGIC; bus_struct_reset : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); peripheral_reset : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); interconnect_aresetn : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); peripheral_aresetn : OUT STD_LOGIC_VECTOR(0 DOWNTO 0) ); END COMPONENT proc_sys_reset; ATTRIBUTE X_CORE_INFO : STRING; ATTRIBUTE X_CORE_INFO OF ip_design_rst_ps7_0_100M_0_arch: ARCHITECTURE IS "proc_sys_reset,Vivado 2017.3"; ATTRIBUTE CHECK_LICENSE_TYPE : STRING; ATTRIBUTE CHECK_LICENSE_TYPE OF ip_design_rst_ps7_0_100M_0_arch : ARCHITECTURE IS "ip_design_rst_ps7_0_100M_0,proc_sys_reset,{}"; ATTRIBUTE CORE_GENERATION_INFO : STRING; ATTRIBUTE CORE_GENERATION_INFO OF ip_design_rst_ps7_0_100M_0_arch: ARCHITECTURE IS "ip_design_rst_ps7_0_100M_0,proc_sys_reset,{x_ipProduct=Vivado 2017.3,x_ipVendor=xilinx.com,x_ipLibrary=ip,x_ipName=proc_sys_reset,x_ipVersion=5.0,x_ipCoreRevision=12,x_ipLanguage=VHDL,x_ipSimLanguage=MIXED,C_FAMILY=zynq,C_EXT_RST_WIDTH=4,C_AUX_RST_WIDTH=4,C_EXT_RESET_HIGH=0,C_AUX_RESET_HIGH=0,C_NUM_BUS_RST=1,C_NUM_PERP_RST=1,C_NUM_INTERCONNECT_ARESETN=1,C_NUM_PERP_ARESETN=1}"; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_PARAMETER : STRING; ATTRIBUTE X_INTERFACE_PARAMETER OF peripheral_aresetn: SIGNAL IS "XIL_INTERFACENAME peripheral_low_rst, POLARITY ACTIVE_LOW, TYPE PERIPHERAL"; ATTRIBUTE X_INTERFACE_INFO OF peripheral_aresetn: SIGNAL IS "xilinx.com:signal:reset:1.0 peripheral_low_rst RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF interconnect_aresetn: SIGNAL IS "XIL_INTERFACENAME interconnect_low_rst, POLARITY ACTIVE_LOW, TYPE INTERCONNECT"; ATTRIBUTE X_INTERFACE_INFO OF interconnect_aresetn: SIGNAL IS "xilinx.com:signal:reset:1.0 interconnect_low_rst RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF peripheral_reset: SIGNAL IS "XIL_INTERFACENAME peripheral_high_rst, POLARITY ACTIVE_HIGH, TYPE PERIPHERAL"; ATTRIBUTE X_INTERFACE_INFO OF peripheral_reset: SIGNAL IS "xilinx.com:signal:reset:1.0 peripheral_high_rst RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF bus_struct_reset: SIGNAL IS "XIL_INTERFACENAME bus_struct_reset, POLARITY ACTIVE_HIGH, TYPE INTERCONNECT"; ATTRIBUTE X_INTERFACE_INFO OF bus_struct_reset: SIGNAL IS "xilinx.com:signal:reset:1.0 bus_struct_reset RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF mb_reset: SIGNAL IS "XIL_INTERFACENAME mb_rst, POLARITY ACTIVE_HIGH, TYPE PROCESSOR"; ATTRIBUTE X_INTERFACE_INFO OF mb_reset: SIGNAL IS "xilinx.com:signal:reset:1.0 mb_rst RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF mb_debug_sys_rst: SIGNAL IS "XIL_INTERFACENAME dbg_reset, POLARITY ACTIVE_HIGH"; ATTRIBUTE X_INTERFACE_INFO OF mb_debug_sys_rst: SIGNAL IS "xilinx.com:signal:reset:1.0 dbg_reset RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF aux_reset_in: SIGNAL IS "XIL_INTERFACENAME aux_reset, POLARITY ACTIVE_LOW"; ATTRIBUTE X_INTERFACE_INFO OF aux_reset_in: SIGNAL IS "xilinx.com:signal:reset:1.0 aux_reset RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF ext_reset_in: SIGNAL IS "XIL_INTERFACENAME ext_reset, BOARD.ASSOCIATED_PARAM RESET_BOARD_INTERFACE, POLARITY ACTIVE_LOW"; ATTRIBUTE X_INTERFACE_INFO OF ext_reset_in: SIGNAL IS "xilinx.com:signal:reset:1.0 ext_reset RST"; ATTRIBUTE X_INTERFACE_PARAMETER OF slowest_sync_clk: SIGNAL IS "XIL_INTERFACENAME clock, ASSOCIATED_RESET mb_reset:bus_struct_reset:interconnect_aresetn:peripheral_aresetn:peripheral_reset, FREQ_HZ 100000000, PHASE 0.000, CLK_DOMAIN ip_design_processing_system7_0_0_FCLK_CLK0"; ATTRIBUTE X_INTERFACE_INFO OF slowest_sync_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clock CLK"; BEGIN U0 : proc_sys_reset GENERIC MAP ( C_FAMILY => "zynq", C_EXT_RST_WIDTH => 4, C_AUX_RST_WIDTH => 4, C_EXT_RESET_HIGH => '0', C_AUX_RESET_HIGH => '0', C_NUM_BUS_RST => 1, C_NUM_PERP_RST => 1, C_NUM_INTERCONNECT_ARESETN => 1, C_NUM_PERP_ARESETN => 1 ) PORT MAP ( slowest_sync_clk => slowest_sync_clk, ext_reset_in => ext_reset_in, aux_reset_in => aux_reset_in, mb_debug_sys_rst => mb_debug_sys_rst, dcm_locked => dcm_locked, mb_reset => mb_reset, bus_struct_reset => bus_struct_reset, peripheral_reset => peripheral_reset, interconnect_aresetn => interconnect_aresetn, peripheral_aresetn => peripheral_aresetn ); END ip_design_rst_ps7_0_100M_0_arch;
-- -- GPIOs on Zybo (only PL) -- -- Author(s): -- * Rodrigo A. Melo -- * Bruno Valinoti -- -- Copyright (c) 2019 Authors and INTI -- Distributed under the BSD 3-Clause License -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library UNISIM; use UNISIM.VCOMPONENTS.all; library FPGALIB; use FPGALIB.verif.all; entity Top is port ( sysclk_p_i : in std_logic; sysclk_n_i : in std_logic; leds_o : out std_logic_vector(3 downto 0) ); end entity Top; architecture RTL of Top is signal clk : std_logic; signal led0, led1, led2, led3 : std_logic; begin blink200MHz_inst: Blink generic map (FREQUENCY => 200e6) port map(clk_i => clk, rst_i => '0', blink_o => led0); ibufgds_inst : IBUFGDS generic map (DIFF_TERM => TRUE, IOSTANDARD => "LVDS") port map (I => sysclk_p_i, IB => sysclk_n_i, O => clk); led1 <= '1'; led2 <= led0; led3 <= '0'; leds_o <= led3 & led2 & led1 & led0; end architecture RTL;
library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity MODULOPRINCIPAL is Port ( rst : in STD_LOGIC; CLK : in STD_LOGIC; ALURESULT : out STD_LOGIC_VECTOR (31 downto 0)); end MODULOPRINCIPAL; architecture Behavioral of MODULOPRINCIPAL is COMPONENT PC PORT( rst : IN std_logic; dataIn : IN std_logic_vector(31 downto 0); CLK : IN std_logic; DataOut : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT Sumador32bits PORT( Oper1 : IN std_logic_vector(31 downto 0); Oper2 : IN std_logic_vector(31 downto 0); Result : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT InstructionMemory PORT( Address : IN std_logic_vector(5 downto 0); rst : IN std_logic; Instruction : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT OMUXT PORT( Crs2 : IN std_logic_vector(31 downto 0); SEUimm : IN std_logic_vector(31 downto 0); i : IN std_logic; oper2 : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT RF PORT( rs1 : IN std_logic_vector(4 downto 0); rs2 : IN std_logic_vector(4 downto 0); rd : IN std_logic_vector(4 downto 0); DWR : IN std_logic_vector(31 downto 0); rst : IN std_logic; Crs1 : OUT std_logic_vector(31 downto 0); Crs2 : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT SEU PORT( imm13 : IN std_logic_vector(12 downto 0); SEUimm : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT ALU PORT( Oper1 : IN std_logic_vector(31 downto 0); Oper2 : IN std_logic_vector(31 downto 0); ALUOP : IN std_logic_vector(5 downto 0); ALURESULT : OUT std_logic_vector(31 downto 0) ); END COMPONENT; COMPONENT CU PORT( OP : IN std_logic_vector(1 downto 0); OP3 : IN std_logic_vector(5 downto 0); ALUOP : OUT std_logic_vector(5 downto 0) ); END COMPONENT; signal B0:std_logic_vector(31 downto 0);--Result: conecta al sumador con el DataIn de nPC signal B1:std_logic_vector(31 downto 0);--DataOut(nPC): conecta al nPC con el DataIn de PC signal B2:std_logic_vector(31 downto 0);--DataOut(PC): conecta al PC con el address del IM y con el Oper2 de sumador32bits signal B3:std_logic_vector(31 downto 0);--Instruction: conecta al IM con el CU(OP(31-30),OP3(24-19)),RF((18-14),rs2(4-0),rd(29-25)), --SEU(imm13(12-0)) y OMUXT(i(13)) signal B4:std_logic_vector(5 downto 0); --ALUOP: conecta a CU y con la ALU signal B5:std_logic_vector(31 downto 0);--ALURESULT: conecta a la ALU con el rd del RF, es la salida del Modulo Principal signal B6:std_logic_vector(31 downto 0);--Crs1: conecta al RF con Oper1 de la ALU signal B7:std_logic_vector(31 downto 0);--Crs2: conecta al RF con OMUXT signal B8:std_logic_vector(31 downto 0);--SEUimm: conecta a SEU con OMUXT signal B9:std_logic_vector(31 downto 0);--Oper2: conecta a OMUXT con el Oper2 de la ALU begin Inst_PC: PC PORT MAP( rst => rst, dataIn => B1, CLK => CLK, DataOut => B2 ); Inst_Sumador32bits: Sumador32bits PORT MAP( Oper1 => "00000000000000000000000000000001", Oper2 => B2, Result => B0 ); Inst_nPC: PC PORT MAP( rst => rst, CLK => CLK, DataIn => B0, DataOut => B1 ); Inst_InstructionMemory: InstructionMemory PORT MAP( Address => B2(5 downto 0), rst => rst, Instruction =>B3 ); Inst_OMUXT: OMUXT PORT MAP( Crs2 => B7, SEUimm => B8, i => B3(13), oper2 => B9 ); Inst_RF: RF PORT MAP( rs1 => B3(18 downto 14), rs2 => B3(4 downto 0), rd => B3(29 downto 25), DWR => B5, rst => rst, Crs1 => B6, Crs2 => B7 ); Inst_SEU: SEU PORT MAP( imm13 => B3(12 downto 0), SEUimm => B8 ); Inst_ALU: ALU PORT MAP( Oper1 => B6, Oper2 => B9, ALUOP => B4, ALURESULT => B5 ); Inst_CU: CU PORT MAP( OP => B3(31 downto 30), OP3 =>B3(24 downto 19) , ALUOP => B4 ); ALURESULT<=B5; end Behavioral;
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity gestor_display is Port ( CLK : in STD_LOGIC; piso_now : in STD_LOGIC_VECTOR (1 downto 0); piso_obj : in STD_LOGIC_VECTOR (1 downto 0); piso_seleccionado : out STD_LOGIC_VECTOR (1 downto 0); piso_actual : out STD_LOGIC_VECTOR (1 downto 0); accion : out STD_LOGIC_VECTOR (1 downto 0) ); end gestor_display; architecture Behavioral of gestor_display is signal piso_act:STD_LOGIC_VECTOR (1 downto 0); begin gestor_display:process(clk) begin if rising_edge(clk) then if (piso_now/="00") then piso_act <= piso_now; end if; piso_seleccionado <= piso_obj; piso_actual <= piso_act; if (piso_obj= "00") then accion <= "01"; elsif (piso_act < piso_obj) then accion <= "11"; elsif (piso_act > piso_obj) then accion <= "00"; else accion <= "10"; end if; end if; end process; end Behavioral;
entity bounds2 is end entity; architecture test of bounds2 is begin asssignment_delays: block signal b1,b2,b3,b4,b5,b6,b7 : boolean; begin b1 <= true; -- OK b2 <= true after 10 ns; -- OK b3 <= true after 0 ns; -- OK b4 <= true after -1 ns; -- Error process begin b5 <= true; -- OK b5 <= true after 0 ns; -- OK b5 <= true after 1 fs; -- OK b5 <= true after -1 fs; -- Error wait; end process; b6 <= true after -10 ns when true else false; b7 <= true when true else false after -10 ns; end block; rejection_limits: block signal b1,b2,b3 : boolean; begin b1 <= reject 10 ns inertial true after 10 ns; -- OK b2 <= reject -10 ns inertial true; -- Error b3 <= reject 10 ns inertial true after 5 ns; -- Error end block; process begin wait for -10 ns; -- Error wait; end process; default_values: block type r is range 0 to 1; constant ok1 : integer range 0 to 1 := 1; -- OK constant ok2 : character range 'a' to 'z' := 'b'; -- OK constant ok3 : real range 0.0 to 1.0 := 0.0; -- OK constant ok4 : time range 10 ns to 20 ns := 10 ns; -- OK constant ok5 : r := 0; -- OK signal s : integer range 0 to 9 := 20; -- Error constant c1 : character range 'a' to 'z' := 'Z'; -- Error shared variable v : real range 0.0 to 5.0 := 10.0; -- Error constant t : time range 10 ns to 10 us := 0 fs; -- Error constant c2 : r := 10; -- Error subtype subint is integer range 1 to 10; procedure test(a : subint := 30) is begin end procedure; function test(a : character range 'a' to 'b' := 'c') return integer is begin return 1; end function; component comp is generic ( g2 : integer range 10 downto 0 := 20 ); port ( p2 : in integer range 0 to 1 := 2 ); end component; begin process is variable v2 : real range 0.0 to 5.0 := 5.1; -- Error begin end process; end block; ascending_time: block signal s : integer; signal del : time; begin process begin s <= 0 after 10 ns, 1 after 11 ns; -- OK s <= 0, 1 after 1 ns; -- OK s <= 10 after del; -- OK s <= 10 after del, 20 after del + 1 ns; -- OK s <= 0, 1; -- Error s <= 0 after 1 ns, 1; -- Error s <= 0 after 2 ns, 1 after 1 ns; -- Error s <= 0 after 1 ns, 1 after del, 2; -- Error s <= 1 after del, 2; -- Error wait; end process; end block; end architecture;
entity bounds2 is end entity; architecture test of bounds2 is begin asssignment_delays: block signal b1,b2,b3,b4,b5,b6,b7 : boolean; begin b1 <= true; -- OK b2 <= true after 10 ns; -- OK b3 <= true after 0 ns; -- OK b4 <= true after -1 ns; -- Error process begin b5 <= true; -- OK b5 <= true after 0 ns; -- OK b5 <= true after 1 fs; -- OK b5 <= true after -1 fs; -- Error wait; end process; b6 <= true after -10 ns when true else false; b7 <= true when true else false after -10 ns; end block; rejection_limits: block signal b1,b2,b3 : boolean; begin b1 <= reject 10 ns inertial true after 10 ns; -- OK b2 <= reject -10 ns inertial true; -- Error b3 <= reject 10 ns inertial true after 5 ns; -- Error end block; process begin wait for -10 ns; -- Error wait; end process; default_values: block type r is range 0 to 1; constant ok1 : integer range 0 to 1 := 1; -- OK constant ok2 : character range 'a' to 'z' := 'b'; -- OK constant ok3 : real range 0.0 to 1.0 := 0.0; -- OK constant ok4 : time range 10 ns to 20 ns := 10 ns; -- OK constant ok5 : r := 0; -- OK signal s : integer range 0 to 9 := 20; -- Error constant c1 : character range 'a' to 'z' := 'Z'; -- Error shared variable v : real range 0.0 to 5.0 := 10.0; -- Error constant t : time range 10 ns to 10 us := 0 fs; -- Error constant c2 : r := 10; -- Error subtype subint is integer range 1 to 10; procedure test(a : subint := 30) is begin end procedure; function test(a : character range 'a' to 'b' := 'c') return integer is begin return 1; end function; component comp is generic ( g2 : integer range 10 downto 0 := 20 ); port ( p2 : in integer range 0 to 1 := 2 ); end component; begin process is variable v2 : real range 0.0 to 5.0 := 5.1; -- Error begin end process; end block; ascending_time: block signal s : integer; signal del : time; begin process begin s <= 0 after 10 ns, 1 after 11 ns; -- OK s <= 0, 1 after 1 ns; -- OK s <= 10 after del; -- OK s <= 10 after del, 20 after del + 1 ns; -- OK s <= 0, 1; -- Error s <= 0 after 1 ns, 1; -- Error s <= 0 after 2 ns, 1 after 1 ns; -- Error s <= 0 after 1 ns, 1 after del, 2; -- Error s <= 1 after del, 2; -- Error wait; end process; end block; end architecture;
-- ------------------------------------------------------------- -- -- File Name: hdl_prj/hdlsrc/OFDM_transmitter/RADIX22FFT_SDNF2_4_block1.vhd -- Created: 2017-03-27 15:50:06 -- -- Generated by MATLAB 9.1 and HDL Coder 3.9 -- -- ------------------------------------------------------------- -- ------------------------------------------------------------- -- -- Module: RADIX22FFT_SDNF2_4_block1 -- Source Path: OFDM_transmitter/IFFT HDL Optimized/RADIX22FFT_SDNF2_4 -- Hierarchy Level: 2 -- -- ------------------------------------------------------------- LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; USE IEEE.numeric_std.ALL; ENTITY RADIX22FFT_SDNF2_4_block1 IS PORT( clk : IN std_logic; reset : IN std_logic; enb_1_16_0 : IN std_logic; rotate_5 : IN std_logic; -- ufix1 dout_5_re : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_5_im : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_7_re : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_7_im : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_1_vld : IN std_logic; softReset : IN std_logic; dout_5_re_1 : OUT std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_5_im_1 : OUT std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_6_re : OUT std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_6_im : OUT std_logic_vector(15 DOWNTO 0); -- sfix16_En13 dout_4_vld : OUT std_logic ); END RADIX22FFT_SDNF2_4_block1; ARCHITECTURE rtl OF RADIX22FFT_SDNF2_4_block1 IS -- Signals SIGNAL dout_5_re_signed : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL dout_5_im_signed : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL dout_7_re_signed : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL dout_7_im_signed : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL Radix22ButterflyG2_NF_din_vld_dly : std_logic; SIGNAL Radix22ButterflyG2_NF_btf1_re_reg : signed(16 DOWNTO 0); -- sfix17 SIGNAL Radix22ButterflyG2_NF_btf1_im_reg : signed(16 DOWNTO 0); -- sfix17 SIGNAL Radix22ButterflyG2_NF_btf2_re_reg : signed(16 DOWNTO 0); -- sfix17 SIGNAL Radix22ButterflyG2_NF_btf2_im_reg : signed(16 DOWNTO 0); -- sfix17 SIGNAL Radix22ButterflyG2_NF_din_vld_dly_next : std_logic; SIGNAL Radix22ButterflyG2_NF_btf1_re_reg_next : signed(16 DOWNTO 0); -- sfix17_En13 SIGNAL Radix22ButterflyG2_NF_btf1_im_reg_next : signed(16 DOWNTO 0); -- sfix17_En13 SIGNAL Radix22ButterflyG2_NF_btf2_re_reg_next : signed(16 DOWNTO 0); -- sfix17_En13 SIGNAL Radix22ButterflyG2_NF_btf2_im_reg_next : signed(16 DOWNTO 0); -- sfix17_En13 SIGNAL dout_5_re_tmp : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL dout_5_im_tmp : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL dout_6_re_tmp : signed(15 DOWNTO 0); -- sfix16_En13 SIGNAL dout_6_im_tmp : signed(15 DOWNTO 0); -- sfix16_En13 BEGIN dout_5_re_signed <= signed(dout_5_re); dout_5_im_signed <= signed(dout_5_im); dout_7_re_signed <= signed(dout_7_re); dout_7_im_signed <= signed(dout_7_im); -- Radix22ButterflyG2_NF Radix22ButterflyG2_NF_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN Radix22ButterflyG2_NF_din_vld_dly <= '0'; Radix22ButterflyG2_NF_btf1_re_reg <= to_signed(16#00000#, 17); Radix22ButterflyG2_NF_btf1_im_reg <= to_signed(16#00000#, 17); Radix22ButterflyG2_NF_btf2_re_reg <= to_signed(16#00000#, 17); Radix22ButterflyG2_NF_btf2_im_reg <= to_signed(16#00000#, 17); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN Radix22ButterflyG2_NF_din_vld_dly <= Radix22ButterflyG2_NF_din_vld_dly_next; Radix22ButterflyG2_NF_btf1_re_reg <= Radix22ButterflyG2_NF_btf1_re_reg_next; Radix22ButterflyG2_NF_btf1_im_reg <= Radix22ButterflyG2_NF_btf1_im_reg_next; Radix22ButterflyG2_NF_btf2_re_reg <= Radix22ButterflyG2_NF_btf2_re_reg_next; Radix22ButterflyG2_NF_btf2_im_reg <= Radix22ButterflyG2_NF_btf2_im_reg_next; END IF; END IF; END PROCESS Radix22ButterflyG2_NF_process; Radix22ButterflyG2_NF_output : PROCESS (Radix22ButterflyG2_NF_din_vld_dly, Radix22ButterflyG2_NF_btf1_re_reg, Radix22ButterflyG2_NF_btf1_im_reg, Radix22ButterflyG2_NF_btf2_re_reg, Radix22ButterflyG2_NF_btf2_im_reg, dout_5_re_signed, dout_5_im_signed, dout_7_re_signed, dout_7_im_signed, dout_1_vld, rotate_5) VARIABLE add_cast : signed(16 DOWNTO 0); VARIABLE add_cast_0 : signed(16 DOWNTO 0); VARIABLE add_cast_1 : signed(16 DOWNTO 0); VARIABLE add_cast_2 : signed(16 DOWNTO 0); VARIABLE sub_cast : signed(16 DOWNTO 0); VARIABLE sub_cast_0 : signed(16 DOWNTO 0); VARIABLE sub_cast_1 : signed(16 DOWNTO 0); VARIABLE sub_cast_2 : signed(16 DOWNTO 0); VARIABLE sra_temp : signed(16 DOWNTO 0); VARIABLE add_cast_3 : signed(16 DOWNTO 0); VARIABLE add_cast_4 : signed(16 DOWNTO 0); VARIABLE add_cast_5 : signed(16 DOWNTO 0); VARIABLE add_cast_6 : signed(16 DOWNTO 0); VARIABLE sra_temp_0 : signed(16 DOWNTO 0); VARIABLE sub_cast_3 : signed(16 DOWNTO 0); VARIABLE sub_cast_4 : signed(16 DOWNTO 0); VARIABLE sub_cast_5 : signed(16 DOWNTO 0); VARIABLE sub_cast_6 : signed(16 DOWNTO 0); VARIABLE sra_temp_1 : signed(16 DOWNTO 0); VARIABLE sra_temp_2 : signed(16 DOWNTO 0); BEGIN Radix22ButterflyG2_NF_btf1_re_reg_next <= Radix22ButterflyG2_NF_btf1_re_reg; Radix22ButterflyG2_NF_btf1_im_reg_next <= Radix22ButterflyG2_NF_btf1_im_reg; Radix22ButterflyG2_NF_btf2_re_reg_next <= Radix22ButterflyG2_NF_btf2_re_reg; Radix22ButterflyG2_NF_btf2_im_reg_next <= Radix22ButterflyG2_NF_btf2_im_reg; Radix22ButterflyG2_NF_din_vld_dly_next <= dout_1_vld; IF rotate_5 /= '0' THEN IF dout_1_vld = '1' THEN add_cast_1 := resize(dout_5_re_signed, 17); add_cast_2 := resize(dout_7_im_signed, 17); Radix22ButterflyG2_NF_btf1_re_reg_next <= add_cast_1 + add_cast_2; sub_cast_1 := resize(dout_5_re_signed, 17); sub_cast_2 := resize(dout_7_im_signed, 17); Radix22ButterflyG2_NF_btf2_re_reg_next <= sub_cast_1 - sub_cast_2; add_cast_5 := resize(dout_5_im_signed, 17); add_cast_6 := resize(dout_7_re_signed, 17); Radix22ButterflyG2_NF_btf2_im_reg_next <= add_cast_5 + add_cast_6; sub_cast_5 := resize(dout_5_im_signed, 17); sub_cast_6 := resize(dout_7_re_signed, 17); Radix22ButterflyG2_NF_btf1_im_reg_next <= sub_cast_5 - sub_cast_6; END IF; ELSIF dout_1_vld = '1' THEN add_cast := resize(dout_5_re_signed, 17); add_cast_0 := resize(dout_7_re_signed, 17); Radix22ButterflyG2_NF_btf1_re_reg_next <= add_cast + add_cast_0; sub_cast := resize(dout_5_re_signed, 17); sub_cast_0 := resize(dout_7_re_signed, 17); Radix22ButterflyG2_NF_btf2_re_reg_next <= sub_cast - sub_cast_0; add_cast_3 := resize(dout_5_im_signed, 17); add_cast_4 := resize(dout_7_im_signed, 17); Radix22ButterflyG2_NF_btf1_im_reg_next <= add_cast_3 + add_cast_4; sub_cast_3 := resize(dout_5_im_signed, 17); sub_cast_4 := resize(dout_7_im_signed, 17); Radix22ButterflyG2_NF_btf2_im_reg_next <= sub_cast_3 - sub_cast_4; END IF; sra_temp := SHIFT_RIGHT(Radix22ButterflyG2_NF_btf1_re_reg, 1); dout_5_re_tmp <= sra_temp(15 DOWNTO 0); sra_temp_0 := SHIFT_RIGHT(Radix22ButterflyG2_NF_btf1_im_reg, 1); dout_5_im_tmp <= sra_temp_0(15 DOWNTO 0); sra_temp_1 := SHIFT_RIGHT(Radix22ButterflyG2_NF_btf2_re_reg, 1); dout_6_re_tmp <= sra_temp_1(15 DOWNTO 0); sra_temp_2 := SHIFT_RIGHT(Radix22ButterflyG2_NF_btf2_im_reg, 1); dout_6_im_tmp <= sra_temp_2(15 DOWNTO 0); dout_4_vld <= Radix22ButterflyG2_NF_din_vld_dly; END PROCESS Radix22ButterflyG2_NF_output; dout_6_re <= std_logic_vector(dout_6_re_tmp); dout_6_im <= std_logic_vector(dout_6_im_tmp); dout_5_re_1 <= std_logic_vector(dout_5_re_tmp); dout_5_im_1 <= std_logic_vector(dout_5_im_tmp); END rtl;
lpm_compare0_inst : lpm_compare0 PORT MAP ( dataa => dataa_sig, datab => datab_sig, AleB => AleB_sig );
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; --------------------------------------------------------------------------------------------- entity lut_3in is generic( NUM_BITS: positive := 163 ); port ( A: in STD_LOGIC_VECTOR(NUM_BITS-1 downto 0); s0: in STD_LOGIC; B: in STD_LOGIC_VECTOR(NUM_BITS-1 downto 0); D: out STD_LOGIC_VECTOR(NUM_BITS-1 downto 0) ); end; --------------------------------------------------------------------------------------------- architecture behave of lut_3in is --------------------------------------------------------------------------- --------------------------------------------------------------------------- begin D(0) <= (A(0) and s0) xor B(0); D(1) <= (A(1) and s0) xor B(1); D(2) <= (A(2) and s0) xor B(2); D(3) <= (A(3) and s0) xor B(3); D(4) <= (A(4) and s0) xor B(4); D(5) <= (A(5) and s0) xor B(5); D(6) <= (A(6) and s0) xor B(6); D(7) <= (A(7) and s0) xor B(7); D(8) <= (A(8) and s0) xor B(8); D(9) <= (A(9) and s0) xor B(9); D(10) <= (A(10) and s0) xor B(10); D(11) <= (A(11) and s0) xor B(11); D(12) <= (A(12) and s0) xor B(12); D(13) <= (A(13) and s0) xor B(13); D(14) <= (A(14) and s0) xor B(14); D(15) <= (A(15) and s0) xor B(15); D(16) <= (A(16) and s0) xor B(16); D(17) <= (A(17) and s0) xor B(17); D(18) <= (A(18) and s0) xor B(18); D(19) <= (A(19) and s0) xor B(19); D(20) <= (A(20) and s0) xor B(20); D(21) <= (A(21) and s0) xor B(21); D(22) <= (A(22) and s0) xor B(22); D(23) <= (A(23) and s0) xor B(23); D(24) <= (A(24) and s0) xor B(24); D(25) <= (A(25) and s0) xor B(25); D(26) <= (A(26) and s0) xor B(26); D(27) <= (A(27) and s0) xor B(27); D(28) <= (A(28) and s0) xor B(28); D(29) <= (A(29) and s0) xor B(29); D(30) <= (A(30) and s0) xor B(30); D(31) <= (A(31) and s0) xor B(31); D(32) <= (A(32) and s0) xor B(32); D(33) <= (A(33) and s0) xor B(33); D(34) <= (A(34) and s0) xor B(34); D(35) <= (A(35) and s0) xor B(35); D(36) <= (A(36) and s0) xor B(36); D(37) <= (A(37) and s0) xor B(37); D(38) <= (A(38) and s0) xor B(38); D(39) <= (A(39) and s0) xor B(39); D(40) <= (A(40) and s0) xor B(40); D(41) <= (A(41) and s0) xor B(41); D(42) <= (A(42) and s0) xor B(42); D(43) <= (A(43) and s0) xor B(43); D(44) <= (A(44) and s0) xor B(44); D(45) <= (A(45) and s0) xor B(45); D(46) <= (A(46) and s0) xor B(46); D(47) <= (A(47) and s0) xor B(47); D(48) <= (A(48) and s0) xor B(48); D(49) <= (A(49) and s0) xor B(49); D(50) <= (A(50) and s0) xor B(50); D(51) <= (A(51) and s0) xor B(51); D(52) <= (A(52) and s0) xor B(52); D(53) <= (A(53) and s0) xor B(53); D(54) <= (A(54) and s0) xor B(54); D(55) <= (A(55) and s0) xor B(55); D(56) <= (A(56) and s0) xor B(56); D(57) <= (A(57) and s0) xor B(57); D(58) <= (A(58) and s0) xor B(58); D(59) <= (A(59) and s0) xor B(59); D(60) <= (A(60) and s0) xor B(60); D(61) <= (A(61) and s0) xor B(61); D(62) <= (A(62) and s0) xor B(62); D(63) <= (A(63) and s0) xor B(63); D(64) <= (A(64) and s0) xor B(64); D(65) <= (A(65) and s0) xor B(65); D(66) <= (A(66) and s0) xor B(66); D(67) <= (A(67) and s0) xor B(67); D(68) <= (A(68) and s0) xor B(68); D(69) <= (A(69) and s0) xor B(69); D(70) <= (A(70) and s0) xor B(70); D(71) <= (A(71) and s0) xor B(71); D(72) <= (A(72) and s0) xor B(72); D(73) <= (A(73) and s0) xor B(73); D(74) <= (A(74) and s0) xor B(74); D(75) <= (A(75) and s0) xor B(75); D(76) <= (A(76) and s0) xor B(76); D(77) <= (A(77) and s0) xor B(77); D(78) <= (A(78) and s0) xor B(78); D(79) <= (A(79) and s0) xor B(79); D(80) <= (A(80) and s0) xor B(80); D(81) <= (A(81) and s0) xor B(81); D(82) <= (A(82) and s0) xor B(82); D(83) <= (A(83) and s0) xor B(83); D(84) <= (A(84) and s0) xor B(84); D(85) <= (A(85) and s0) xor B(85); D(86) <= (A(86) and s0) xor B(86); D(87) <= (A(87) and s0) xor B(87); D(88) <= (A(88) and s0) xor B(88); D(89) <= (A(89) and s0) xor B(89); D(90) <= (A(90) and s0) xor B(90); D(91) <= (A(91) and s0) xor B(91); D(92) <= (A(92) and s0) xor B(92); D(93) <= (A(93) and s0) xor B(93); D(94) <= (A(94) and s0) xor B(94); D(95) <= (A(95) and s0) xor B(95); D(96) <= (A(96) and s0) xor B(96); D(97) <= (A(97) and s0) xor B(97); D(98) <= (A(98) and s0) xor B(98); D(99) <= (A(99) and s0) xor B(99); D(100) <= (A(100) and s0) xor B(100); D(101) <= (A(101) and s0) xor B(101); D(102) <= (A(102) and s0) xor B(102); D(103) <= (A(103) and s0) xor B(103); D(104) <= (A(104) and s0) xor B(104); D(105) <= (A(105) and s0) xor B(105); D(106) <= (A(106) and s0) xor B(106); D(107) <= (A(107) and s0) xor B(107); D(108) <= (A(108) and s0) xor B(108); D(109) <= (A(109) and s0) xor B(109); D(110) <= (A(110) and s0) xor B(110); D(111) <= (A(111) and s0) xor B(111); D(112) <= (A(112) and s0) xor B(112); D(113) <= (A(113) and s0) xor B(113); D(114) <= (A(114) and s0) xor B(114); D(115) <= (A(115) and s0) xor B(115); D(116) <= (A(116) and s0) xor B(116); D(117) <= (A(117) and s0) xor B(117); D(118) <= (A(118) and s0) xor B(118); D(119) <= (A(119) and s0) xor B(119); D(120) <= (A(120) and s0) xor B(120); D(121) <= (A(121) and s0) xor B(121); D(122) <= (A(122) and s0) xor B(122); D(123) <= (A(123) and s0) xor B(123); D(124) <= (A(124) and s0) xor B(124); D(125) <= (A(125) and s0) xor B(125); D(126) <= (A(126) and s0) xor B(126); D(127) <= (A(127) and s0) xor B(127); D(128) <= (A(128) and s0) xor B(128); D(129) <= (A(129) and s0) xor B(129); D(130) <= (A(130) and s0) xor B(130); D(131) <= (A(131) and s0) xor B(131); D(132) <= (A(132) and s0) xor B(132); D(133) <= (A(133) and s0) xor B(133); D(134) <= (A(134) and s0) xor B(134); D(135) <= (A(135) and s0) xor B(135); D(136) <= (A(136) and s0) xor B(136); D(137) <= (A(137) and s0) xor B(137); D(138) <= (A(138) and s0) xor B(138); D(139) <= (A(139) and s0) xor B(139); D(140) <= (A(140) and s0) xor B(140); D(141) <= (A(141) and s0) xor B(141); D(142) <= (A(142) and s0) xor B(142); D(143) <= (A(143) and s0) xor B(143); D(144) <= (A(144) and s0) xor B(144); D(145) <= (A(145) and s0) xor B(145); D(146) <= (A(146) and s0) xor B(146); D(147) <= (A(147) and s0) xor B(147); D(148) <= (A(148) and s0) xor B(148); D(149) <= (A(149) and s0) xor B(149); D(150) <= (A(150) and s0) xor B(150); D(151) <= (A(151) and s0) xor B(151); D(152) <= (A(152) and s0) xor B(152); D(153) <= (A(153) and s0) xor B(153); D(154) <= (A(154) and s0) xor B(154); D(155) <= (A(155) and s0) xor B(155); D(156) <= (A(156) and s0) xor B(156); D(157) <= (A(157) and s0) xor B(157); D(158) <= (A(158) and s0) xor B(158); D(159) <= (A(159) and s0) xor B(159); D(160) <= (A(160) and s0) xor B(160); D(161) <= (A(161) and s0) xor B(161); D(162) <= (A(162) and s0) xor B(162); end;
-- ------------------------------------------------------------- -- -- Generated Architecture Declaration for rtl of inst_ed_e -- -- Generated -- by: wig -- on: Mon Apr 10 13:27:22 2006 -- cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -nodelta ../../bitsplice.xls -- -- !!! Do not edit this file! Autogenerated by MIX !!! -- $Author: wig $ -- $Id: inst_ed_e-rtl-a.vhd,v 1.1 2006/04/10 15:42:08 wig Exp $ -- $Date: 2006/04/10 15:42:08 $ -- $Log: inst_ed_e-rtl-a.vhd,v $ -- Revision 1.1 2006/04/10 15:42:08 wig -- Updated testcase (__TOP__) -- -- -- Based on Mix Architecture Template built into RCSfile: MixWriter.pm,v -- Id: MixWriter.pm,v 1.79 2006/03/17 09:18:31 wig Exp -- -- Generator: mix_0.pl Revision: 1.44 , wilfried.gaensheimer@micronas.com -- (C) 2003,2005 Micronas GmbH -- -- -------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; -- No project specific VHDL libraries/arch -- -- -- Start of Generated Architecture rtl of inst_ed_e -- architecture rtl of inst_ed_e is -- Generated Constant Declarations -- -- Components -- -- Generated Components component inst_eda_e -- No Generated Generics -- Generated Generics for Entity inst_eda_e -- End of Generated Generics for Entity inst_eda_e -- No Generated Port end component; -- --------- component inst_edb_e -- No Generated Generics -- Generated Generics for Entity inst_edb_e -- End of Generated Generics for Entity inst_edb_e -- No Generated Port end component; -- --------- -- -- Nets -- -- -- Generated Signal List -- -- -- End of Generated Signal List -- begin -- -- Generated Concurrent Statements -- -- Generated Signal Assignments -- -- Generated Instances -- -- Generated Instances and Port Mappings -- Generated Instance Port Map for inst_eda inst_eda: inst_eda_e ; -- End of Generated Instance Port Map for inst_eda -- Generated Instance Port Map for inst_edb inst_edb: inst_edb_e ; -- End of Generated Instance Port Map for inst_edb end rtl; -- --!End of Architecture/s -- --------------------------------------------------------------
-- -- synthesis test 2: -- * without clock enable -- * slow -- -- -- Altera EP2C-8, Quartus 8.0: (same as hw1_grain128) library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity hw2_grain128 is port ( CLK_I : in std_logic; ARESET_I : in std_logic; KEY_I : in std_logic; IV_I : in std_logic; INIT_I: in std_logic; KEYSTREAM_O : out std_logic; KEYSTREAM_VALID_O : out std_logic ); end entity; architecture behav of hw2_grain128 is begin top: entity work.grain128 generic map ( DEBUG => false, FAST => false ) port map ( CLK_I => CLK_I, CLKEN_I => '1', ARESET_I => ARESET_I, KEY_I => KEY_I, IV_I => IV_I, INIT_I=> INIT_I, KEYSTREAM_O => KEYSTREAM_O, KEYSTREAM_VALID_O => KEYSTREAM_VALID_O ); end behav;
-- Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2016.4 (win64) Build 1733598 Wed Dec 14 22:35:39 MST 2016 -- Date : Mon Feb 13 12:46:56 2017 -- Host : WK117 running 64-bit major release (build 9200) -- Command : write_vhdl -force -mode synth_stub -- C:/Users/aholzer/Documents/new/Arty-BSD/src/bd/system/ip/system_axi_uartlite_0_0/system_axi_uartlite_0_0_stub.vhdl -- Design : system_axi_uartlite_0_0 -- Purpose : Stub declaration of top-level module interface -- Device : xc7a35ticsg324-1L -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity system_axi_uartlite_0_0 is Port ( s_axi_aclk : in STD_LOGIC; s_axi_aresetn : in STD_LOGIC; interrupt : out STD_LOGIC; s_axi_awaddr : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awvalid : in STD_LOGIC; s_axi_awready : out STD_LOGIC; s_axi_wdata : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_wstrb : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_wvalid : in STD_LOGIC; s_axi_wready : out STD_LOGIC; s_axi_bresp : out STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_bvalid : out STD_LOGIC; s_axi_bready : in STD_LOGIC; s_axi_araddr : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arvalid : in STD_LOGIC; s_axi_arready : out STD_LOGIC; s_axi_rdata : out STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_rresp : out STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_rvalid : out STD_LOGIC; s_axi_rready : in STD_LOGIC; rx : in STD_LOGIC; tx : out STD_LOGIC ); end system_axi_uartlite_0_0; architecture stub of system_axi_uartlite_0_0 is attribute syn_black_box : boolean; attribute black_box_pad_pin : string; attribute syn_black_box of stub : architecture is true; attribute black_box_pad_pin of stub : architecture is "s_axi_aclk,s_axi_aresetn,interrupt,s_axi_awaddr[3:0],s_axi_awvalid,s_axi_awready,s_axi_wdata[31:0],s_axi_wstrb[3:0],s_axi_wvalid,s_axi_wready,s_axi_bresp[1:0],s_axi_bvalid,s_axi_bready,s_axi_araddr[3:0],s_axi_arvalid,s_axi_arready,s_axi_rdata[31:0],s_axi_rresp[1:0],s_axi_rvalid,s_axi_rready,rx,tx"; attribute x_core_info : string; attribute x_core_info of stub : architecture is "axi_uartlite,Vivado 2016.4"; begin end;
--------------------------------------------------------------------------- -- logic_unit.vhd -- -- Sai Koppula -- -- 3-13 -- -- -- -- Purpose/Description -- -- Takes in make_code and outputs the right direction -- -- -- -- -- -- Final Modifications by Raj Vinjamuri and Sai Koppula -- -- -- -- -- --Updates -- -- -- -- >fixed 11 downto 0 -- --------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity logic_unit is Port ( SR_In : in std_logic_vector(10 downto 0); PR_In : in std_logic_vector(10 downto 0); -- Up, Do, Le, Ri : out std_logic; WW, SS, AA, DD : out std_logic; QQ, EE, RR : out std_logic; One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Zero : out std_logic; Plus, Minus : out std_logic; Spacebar : out std_logic); end logic_unit; architecture Behavioral of logic_unit is signal break_code : std_logic_vector(7 downto 0); begin break_code <= "11110000"; --set the break code (supposed to be F0) to F8 here decideMove: process(SR_In, PR_In) begin if (SR_In(8 downto 1) = "00011101") --W then if (PR_In(8 downto 1) /= break_code) then WW <= '1'; else WW <= '0'; end if; else WW <= '0'; end if; if (SR_In(8 downto 1) = "00011011") --S then if (PR_In(8 downto 1) /= break_code) then SS <= '1'; else SS <= '0'; end if; else SS <= '0'; end if; if (SR_In(8 downto 1) = "00011100") --A then if (PR_In(8 downto 1) /= break_code) -- THIS WAS HACKED, FIND BETTER SOLUTION (Break code was coming out as F8 instead of F0) then AA <= '1'; else AA <= '0'; end if; else AA <= '0'; end if; if (SR_In(8 downto 1) = "00100011") --D then if (PR_In(8 downto 1) /= break_code) -- THIS WAS HACKED, FIND BETTER SOLUTION then DD <= '1'; else DD <= '0'; end if; else DD <= '0'; end if; -------------------------------------------- if (SR_In(8 downto 1) = "00010110") --1 then if (PR_In(8 downto 1) /= break_code) then One <= '1'; else One <= '0'; end if; else One <= '0'; end if; if (SR_In(8 downto 1) = "00011110") --2 then if (PR_In(8 downto 1) /= break_code) then Two <= '1'; else Two <= '0'; end if; else Two <= '0'; end if; if (SR_In(8 downto 1) = "00100110") --3 then if (PR_In(8 downto 1) /= break_code) then Three <= '1'; else Three <= '0'; end if; else Three <= '0'; end if; if (SR_In(8 downto 1) = "00100101") --4 then if (PR_In(8 downto 1) /= break_code) then Four <= '1'; else Four <= '0'; end if; else Four <= '0'; end if; if (SR_In(8 downto 1) = "00101110") --5 then if (PR_In(8 downto 1) /= break_code) then Five <= '1'; else Five <= '0'; end if; else Five <= '0'; end if; if (SR_In(8 downto 1) = "00100110") --6 then if (PR_In(8 downto 1) /= break_code) then Six <= '1'; else Six <= '0'; end if; else Six <= '0'; end if; if (SR_In(8 downto 1) = "00111101") --7 then if (PR_In(8 downto 1) /= break_code) then Seven <= '1'; else Seven <= '0'; end if; else Seven <= '0'; end if; if (SR_In(8 downto 1) = "00111110") --8 then if (PR_In(8 downto 1) /= break_code) then Eight <= '1'; else Eight <= '0'; end if; else Eight <= '0'; end if; if (SR_In(8 downto 1) = "01000110") --9 then if (PR_In(8 downto 1) /= break_code) then Nine <= '1'; else Nine <= '0'; end if; else Nine <= '0'; end if; if (SR_In(8 downto 1) = "01000101") --0 then if (PR_In(8 downto 1) /= break_code) then Zero <= '1'; else Zero <= '0'; end if; else Zero <= '0'; end if; -------------------------------------------- if (SR_In(8 downto 1) = "00010101") --Q then if (PR_In(8 downto 1) /= break_code) then QQ <= '1'; else QQ <= '0'; end if; else QQ <= '0'; end if; if (SR_In(8 downto 1) = "00100100") --E then if (PR_In(8 downto 1) /= break_code) then EE <= '1'; else EE <= '0'; end if; else EE <= '0'; end if; if (SR_In(8 downto 1) = "00101101") --R then if (PR_In(8 downto 1) /= break_code) then RR <= '1'; else RR <= '0'; end if; else RR <= '0'; end if; -------------------------------------------- if (SR_In(8 downto 1) = "01010101") --Plus then if (PR_In(8 downto 1) /= break_code) then Plus <= '1'; else Plus <= '0'; end if; else Plus <= '0'; end if; if (SR_In(8 downto 1) = "01001110") --Minus then if (PR_In(8 downto 1) /= break_code) then Minus <= '1'; else Minus <= '0'; end if; else Minus <= '0'; end if; if (SR_In(8 downto 1) = "00101001") --Spacebar then if (PR_In(8 downto 1) /= break_code) then Spacebar <= '1'; else Spacebar <= '0'; end if; else Spacebar <= '0'; end if; end process; end Behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
------------------------------------------------------------------------------------- -- Copyright (c) 2006, University of Kansas - Hybridthreads Group -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the University of Kansas nor the name of the -- Hybridthreads Group nor the names of its contributors may be used to -- endorse or promote products derived from this software without specific -- prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_misc.all; use work.common.all; entity owner_fsm is generic ( C_AWIDTH : integer := 32; C_DWIDTH : integer := 32; C_TWIDTH : integer := 8; C_MWIDTH : integer := 6; C_CWIDTH : integer := 8 ); port ( clk : in std_logic; rst : in std_logic; start : in std_logic; finish : out std_logic; data : out std_logic_vector(0 to C_DWIDTH-1); mutex : in std_logic_vector(0 to C_MWIDTH-1); thread : in std_logic_vector(0 to C_TWIDTH-1); miowner : in std_logic_vector(0 to C_TWIDTH-1); minext : in std_logic_vector(0 to C_TWIDTH-1); milast : in std_logic_vector(0 to C_TWIDTH-1); micount : in std_logic_vector(0 to C_CWIDTH-1); mikind : in std_logic_vector(0 to 1); tinext : in std_logic_vector(0 to C_TWIDTH-1); moaddr : out std_logic_vector(0 to C_MWIDTH-1); moena : out std_logic; mowea : out std_logic; moowner : out std_logic_vector(0 to C_TWIDTH-1); monext : out std_logic_vector(0 to C_TWIDTH-1); molast : out std_logic_vector(0 to C_TWIDTH-1); mocount : out std_logic_vector(0 to C_CWIDTH-1); mokind : out std_logic_vector(0 to 1); sysrst : in std_logic; rstdone : out std_logic; toaddr : out std_logic_vector(0 to C_TWIDTH-1); toena : out std_logic; towea : out std_logic; tonext : out std_logic_vector(0 to C_TWIDTH-1) ); end owner_fsm; architecture behavioral of owner_fsm is -- A type for the states in the owner fsm type owner_state is ( IDLE, READ, DONE ); -- Declare signals for the owner fsm signal owner_cs : owner_state; signal owner_ns : owner_state; -- Alias owner output alias odata : std_logic_vector(0 to C_TWIDTH-1) is data(C_DWIDTH-C_TWIDTH to C_DWIDTH-1); begin -- This core resets in one clock cycle so it is always "done" rstdone <= '1'; owner_update : process(clk,rst,sysrst,owner_ns) is begin if( rising_edge(clk) ) then if( rst = '1' or sysrst = '1' ) then owner_cs <= IDLE; else owner_cs <= owner_ns; end if; end if; end process owner_update; owner_controller : process(owner_cs,start,mutex,miowner) is begin owner_ns <= owner_cs; finish <= '0'; data <= (others => '0'); moaddr <= (others => '0'); moena <= '0'; mowea <= '0'; moowner <= (others => '0'); monext <= (others => '0'); molast <= (others => '0'); mokind <= (others => '0'); mocount <= (others => '0'); toaddr <= (others => '0'); toena <= '0'; towea <= '0'; tonext <= (others => '0'); case owner_cs is when IDLE => if( start = '1' ) then moaddr <= mutex; moena <= '1'; mowea <= '0'; owner_ns <= READ; end if; when READ => owner_ns <= DONE; when DONE => finish <= '1'; odata <= miowner; owner_ns <= IDLE; end case; end process owner_controller; end behavioral;
component ghrd_10as066n2_rst_bdg is port ( clk : in std_logic := 'X'; -- clk in_reset : in std_logic := 'X'; -- reset out_reset : out std_logic -- reset ); end component ghrd_10as066n2_rst_bdg; u0 : component ghrd_10as066n2_rst_bdg port map ( clk => CONNECTED_TO_clk, -- clk.clk in_reset => CONNECTED_TO_in_reset, -- in_reset.reset out_reset => CONNECTED_TO_out_reset -- out_reset.reset );
-- Copyright 1986-2014 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2014.1 (lin64) Build 881834 Fri Apr 4 14:00:25 MDT 2014 -- Date : Thu May 1 14:04:03 2014 -- Host : macbook running 64-bit Arch Linux -- Command : write_vhdl -force -mode funcsim -- /home/keith/Documents/VHDL-lib/top/lab_7/part_3/ip/clk_adc/clk_adc_funcsim.vhdl -- Design : clk_adc -- Purpose : This VHDL netlist is a functional simulation representation of the design and should not be modified or -- synthesized. This netlist cannot be used for SDF annotated simulation. -- Device : xc7z020clg484-1 -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; entity clk_adcclk_adc_clk_wiz is port ( clk_in1_p : in STD_LOGIC; clk_in1_n : in STD_LOGIC; clk_250Mhz : out STD_LOGIC; locked : out STD_LOGIC ); attribute ORIG_REF_NAME : string; attribute ORIG_REF_NAME of clk_adcclk_adc_clk_wiz : entity is "clk_adc_clk_wiz"; end clk_adcclk_adc_clk_wiz; architecture STRUCTURE of clk_adcclk_adc_clk_wiz is signal clk_250Mhz_clk_adc : STD_LOGIC; signal clk_in1_clk_adc : STD_LOGIC; signal clkfbout_buf_clk_adc : STD_LOGIC; signal clkfbout_clk_adc : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKFBOUTB_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKFBSTOPPED_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKINSTOPPED_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT0B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT1_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT1B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT2_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT2B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT3_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT3B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT4_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT5_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT6_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_DRDY_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_PSDONE_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_DO_UNCONNECTED : STD_LOGIC_VECTOR ( 15 downto 0 ); attribute box_type : string; attribute box_type of clkf_buf : label is "PRIMITIVE"; attribute CAPACITANCE : string; attribute CAPACITANCE of clkin1_ibufgds : label is "DONT_CARE"; attribute IBUF_DELAY_VALUE : string; attribute IBUF_DELAY_VALUE of clkin1_ibufgds : label is "0"; attribute IFD_DELAY_VALUE : string; attribute IFD_DELAY_VALUE of clkin1_ibufgds : label is "AUTO"; attribute box_type of clkin1_ibufgds : label is "PRIMITIVE"; attribute box_type of clkout1_buf : label is "PRIMITIVE"; attribute box_type of mmcm_adv_inst : label is "PRIMITIVE"; begin clkf_buf: unisim.vcomponents.BUFG port map ( I => clkfbout_clk_adc, O => clkfbout_buf_clk_adc ); clkin1_ibufgds: unisim.vcomponents.IBUFDS generic map( DQS_BIAS => "FALSE", IOSTANDARD => "DEFAULT" ) port map ( I => clk_in1_p, IB => clk_in1_n, O => clk_in1_clk_adc ); clkout1_buf: unisim.vcomponents.BUFG port map ( I => clk_250Mhz_clk_adc, O => clk_250Mhz ); mmcm_adv_inst: unisim.vcomponents.MMCME2_ADV generic map( BANDWIDTH => "OPTIMIZED", CLKFBOUT_MULT_F => 4.000000, CLKFBOUT_PHASE => 0.000000, CLKFBOUT_USE_FINE_PS => false, CLKIN1_PERIOD => 4.000000, CLKIN2_PERIOD => 0.000000, CLKOUT0_DIVIDE_F => 4.000000, CLKOUT0_DUTY_CYCLE => 0.500000, CLKOUT0_PHASE => 236.250000, CLKOUT0_USE_FINE_PS => false, CLKOUT1_DIVIDE => 1, CLKOUT1_DUTY_CYCLE => 0.500000, CLKOUT1_PHASE => 0.000000, CLKOUT1_USE_FINE_PS => false, CLKOUT2_DIVIDE => 1, CLKOUT2_DUTY_CYCLE => 0.500000, CLKOUT2_PHASE => 0.000000, CLKOUT2_USE_FINE_PS => false, CLKOUT3_DIVIDE => 1, CLKOUT3_DUTY_CYCLE => 0.500000, CLKOUT3_PHASE => 0.000000, CLKOUT3_USE_FINE_PS => false, CLKOUT4_CASCADE => false, CLKOUT4_DIVIDE => 1, CLKOUT4_DUTY_CYCLE => 0.500000, CLKOUT4_PHASE => 0.000000, CLKOUT4_USE_FINE_PS => false, CLKOUT5_DIVIDE => 1, CLKOUT5_DUTY_CYCLE => 0.500000, CLKOUT5_PHASE => 0.000000, CLKOUT5_USE_FINE_PS => false, CLKOUT6_DIVIDE => 1, CLKOUT6_DUTY_CYCLE => 0.500000, CLKOUT6_PHASE => 0.000000, CLKOUT6_USE_FINE_PS => false, COMPENSATION => "ZHOLD", DIVCLK_DIVIDE => 1, IS_CLKINSEL_INVERTED => '0', IS_PSEN_INVERTED => '0', IS_PSINCDEC_INVERTED => '0', IS_PWRDWN_INVERTED => '0', IS_RST_INVERTED => '0', REF_JITTER1 => 0.010000, REF_JITTER2 => 0.000000, SS_EN => "FALSE", SS_MODE => "CENTER_HIGH", SS_MOD_PERIOD => 10000, STARTUP_WAIT => false ) port map ( CLKFBIN => clkfbout_buf_clk_adc, CLKFBOUT => clkfbout_clk_adc, CLKFBOUTB => NLW_mmcm_adv_inst_CLKFBOUTB_UNCONNECTED, CLKFBSTOPPED => NLW_mmcm_adv_inst_CLKFBSTOPPED_UNCONNECTED, CLKIN1 => clk_in1_clk_adc, CLKIN2 => '0', CLKINSEL => '1', CLKINSTOPPED => NLW_mmcm_adv_inst_CLKINSTOPPED_UNCONNECTED, CLKOUT0 => clk_250Mhz_clk_adc, CLKOUT0B => NLW_mmcm_adv_inst_CLKOUT0B_UNCONNECTED, CLKOUT1 => NLW_mmcm_adv_inst_CLKOUT1_UNCONNECTED, CLKOUT1B => NLW_mmcm_adv_inst_CLKOUT1B_UNCONNECTED, CLKOUT2 => NLW_mmcm_adv_inst_CLKOUT2_UNCONNECTED, CLKOUT2B => NLW_mmcm_adv_inst_CLKOUT2B_UNCONNECTED, CLKOUT3 => NLW_mmcm_adv_inst_CLKOUT3_UNCONNECTED, CLKOUT3B => NLW_mmcm_adv_inst_CLKOUT3B_UNCONNECTED, CLKOUT4 => NLW_mmcm_adv_inst_CLKOUT4_UNCONNECTED, CLKOUT5 => NLW_mmcm_adv_inst_CLKOUT5_UNCONNECTED, CLKOUT6 => NLW_mmcm_adv_inst_CLKOUT6_UNCONNECTED, DADDR(6) => '0', DADDR(5) => '0', DADDR(4) => '0', DADDR(3) => '0', DADDR(2) => '0', DADDR(1) => '0', DADDR(0) => '0', DCLK => '0', DEN => '0', DI(15) => '0', DI(14) => '0', DI(13) => '0', DI(12) => '0', DI(11) => '0', DI(10) => '0', DI(9) => '0', DI(8) => '0', DI(7) => '0', DI(6) => '0', DI(5) => '0', DI(4) => '0', DI(3) => '0', DI(2) => '0', DI(1) => '0', DI(0) => '0', DO(15 downto 0) => NLW_mmcm_adv_inst_DO_UNCONNECTED(15 downto 0), DRDY => NLW_mmcm_adv_inst_DRDY_UNCONNECTED, DWE => '0', LOCKED => locked, PSCLK => '0', PSDONE => NLW_mmcm_adv_inst_PSDONE_UNCONNECTED, PSEN => '0', PSINCDEC => '0', PWRDWN => '0', RST => '0' ); end STRUCTURE; library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; entity clk_adc is port ( clk_in1_p : in STD_LOGIC; clk_in1_n : in STD_LOGIC; clk_250Mhz : out STD_LOGIC; locked : out STD_LOGIC ); attribute NotValidForBitStream : boolean; attribute NotValidForBitStream of clk_adc : entity is true; attribute core_generation_info : string; attribute core_generation_info of clk_adc : entity is "clk_adc,clk_wiz_v5_1,{component_name=clk_adc,use_phase_alignment=true,use_min_o_jitter=false,use_max_i_jitter=false,use_dyn_phase_shift=false,use_inclk_switchover=false,use_dyn_reconfig=false,enable_axi=0,feedback_source=FDBK_AUTO,PRIMITIVE=MMCM,num_out_clk=1,clkin1_period=4.0,clkin2_period=10.0,use_power_down=false,use_reset=false,use_locked=true,use_inclk_stopped=false,feedback_type=SINGLE,CLOCK_MGR_TYPE=NA,manual_override=false}"; end clk_adc; architecture STRUCTURE of clk_adc is begin U0: entity work.clk_adcclk_adc_clk_wiz port map ( clk_250Mhz => clk_250Mhz, clk_in1_n => clk_in1_n, clk_in1_p => clk_in1_p, locked => locked ); end STRUCTURE;
-- Copyright 1986-2014 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2014.1 (lin64) Build 881834 Fri Apr 4 14:00:25 MDT 2014 -- Date : Thu May 1 14:04:03 2014 -- Host : macbook running 64-bit Arch Linux -- Command : write_vhdl -force -mode funcsim -- /home/keith/Documents/VHDL-lib/top/lab_7/part_3/ip/clk_adc/clk_adc_funcsim.vhdl -- Design : clk_adc -- Purpose : This VHDL netlist is a functional simulation representation of the design and should not be modified or -- synthesized. This netlist cannot be used for SDF annotated simulation. -- Device : xc7z020clg484-1 -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; entity clk_adcclk_adc_clk_wiz is port ( clk_in1_p : in STD_LOGIC; clk_in1_n : in STD_LOGIC; clk_250Mhz : out STD_LOGIC; locked : out STD_LOGIC ); attribute ORIG_REF_NAME : string; attribute ORIG_REF_NAME of clk_adcclk_adc_clk_wiz : entity is "clk_adc_clk_wiz"; end clk_adcclk_adc_clk_wiz; architecture STRUCTURE of clk_adcclk_adc_clk_wiz is signal clk_250Mhz_clk_adc : STD_LOGIC; signal clk_in1_clk_adc : STD_LOGIC; signal clkfbout_buf_clk_adc : STD_LOGIC; signal clkfbout_clk_adc : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKFBOUTB_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKFBSTOPPED_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKINSTOPPED_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT0B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT1_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT1B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT2_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT2B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT3_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT3B_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT4_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT5_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_CLKOUT6_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_DRDY_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_PSDONE_UNCONNECTED : STD_LOGIC; signal NLW_mmcm_adv_inst_DO_UNCONNECTED : STD_LOGIC_VECTOR ( 15 downto 0 ); attribute box_type : string; attribute box_type of clkf_buf : label is "PRIMITIVE"; attribute CAPACITANCE : string; attribute CAPACITANCE of clkin1_ibufgds : label is "DONT_CARE"; attribute IBUF_DELAY_VALUE : string; attribute IBUF_DELAY_VALUE of clkin1_ibufgds : label is "0"; attribute IFD_DELAY_VALUE : string; attribute IFD_DELAY_VALUE of clkin1_ibufgds : label is "AUTO"; attribute box_type of clkin1_ibufgds : label is "PRIMITIVE"; attribute box_type of clkout1_buf : label is "PRIMITIVE"; attribute box_type of mmcm_adv_inst : label is "PRIMITIVE"; begin clkf_buf: unisim.vcomponents.BUFG port map ( I => clkfbout_clk_adc, O => clkfbout_buf_clk_adc ); clkin1_ibufgds: unisim.vcomponents.IBUFDS generic map( DQS_BIAS => "FALSE", IOSTANDARD => "DEFAULT" ) port map ( I => clk_in1_p, IB => clk_in1_n, O => clk_in1_clk_adc ); clkout1_buf: unisim.vcomponents.BUFG port map ( I => clk_250Mhz_clk_adc, O => clk_250Mhz ); mmcm_adv_inst: unisim.vcomponents.MMCME2_ADV generic map( BANDWIDTH => "OPTIMIZED", CLKFBOUT_MULT_F => 4.000000, CLKFBOUT_PHASE => 0.000000, CLKFBOUT_USE_FINE_PS => false, CLKIN1_PERIOD => 4.000000, CLKIN2_PERIOD => 0.000000, CLKOUT0_DIVIDE_F => 4.000000, CLKOUT0_DUTY_CYCLE => 0.500000, CLKOUT0_PHASE => 236.250000, CLKOUT0_USE_FINE_PS => false, CLKOUT1_DIVIDE => 1, CLKOUT1_DUTY_CYCLE => 0.500000, CLKOUT1_PHASE => 0.000000, CLKOUT1_USE_FINE_PS => false, CLKOUT2_DIVIDE => 1, CLKOUT2_DUTY_CYCLE => 0.500000, CLKOUT2_PHASE => 0.000000, CLKOUT2_USE_FINE_PS => false, CLKOUT3_DIVIDE => 1, CLKOUT3_DUTY_CYCLE => 0.500000, CLKOUT3_PHASE => 0.000000, CLKOUT3_USE_FINE_PS => false, CLKOUT4_CASCADE => false, CLKOUT4_DIVIDE => 1, CLKOUT4_DUTY_CYCLE => 0.500000, CLKOUT4_PHASE => 0.000000, CLKOUT4_USE_FINE_PS => false, CLKOUT5_DIVIDE => 1, CLKOUT5_DUTY_CYCLE => 0.500000, CLKOUT5_PHASE => 0.000000, CLKOUT5_USE_FINE_PS => false, CLKOUT6_DIVIDE => 1, CLKOUT6_DUTY_CYCLE => 0.500000, CLKOUT6_PHASE => 0.000000, CLKOUT6_USE_FINE_PS => false, COMPENSATION => "ZHOLD", DIVCLK_DIVIDE => 1, IS_CLKINSEL_INVERTED => '0', IS_PSEN_INVERTED => '0', IS_PSINCDEC_INVERTED => '0', IS_PWRDWN_INVERTED => '0', IS_RST_INVERTED => '0', REF_JITTER1 => 0.010000, REF_JITTER2 => 0.000000, SS_EN => "FALSE", SS_MODE => "CENTER_HIGH", SS_MOD_PERIOD => 10000, STARTUP_WAIT => false ) port map ( CLKFBIN => clkfbout_buf_clk_adc, CLKFBOUT => clkfbout_clk_adc, CLKFBOUTB => NLW_mmcm_adv_inst_CLKFBOUTB_UNCONNECTED, CLKFBSTOPPED => NLW_mmcm_adv_inst_CLKFBSTOPPED_UNCONNECTED, CLKIN1 => clk_in1_clk_adc, CLKIN2 => '0', CLKINSEL => '1', CLKINSTOPPED => NLW_mmcm_adv_inst_CLKINSTOPPED_UNCONNECTED, CLKOUT0 => clk_250Mhz_clk_adc, CLKOUT0B => NLW_mmcm_adv_inst_CLKOUT0B_UNCONNECTED, CLKOUT1 => NLW_mmcm_adv_inst_CLKOUT1_UNCONNECTED, CLKOUT1B => NLW_mmcm_adv_inst_CLKOUT1B_UNCONNECTED, CLKOUT2 => NLW_mmcm_adv_inst_CLKOUT2_UNCONNECTED, CLKOUT2B => NLW_mmcm_adv_inst_CLKOUT2B_UNCONNECTED, CLKOUT3 => NLW_mmcm_adv_inst_CLKOUT3_UNCONNECTED, CLKOUT3B => NLW_mmcm_adv_inst_CLKOUT3B_UNCONNECTED, CLKOUT4 => NLW_mmcm_adv_inst_CLKOUT4_UNCONNECTED, CLKOUT5 => NLW_mmcm_adv_inst_CLKOUT5_UNCONNECTED, CLKOUT6 => NLW_mmcm_adv_inst_CLKOUT6_UNCONNECTED, DADDR(6) => '0', DADDR(5) => '0', DADDR(4) => '0', DADDR(3) => '0', DADDR(2) => '0', DADDR(1) => '0', DADDR(0) => '0', DCLK => '0', DEN => '0', DI(15) => '0', DI(14) => '0', DI(13) => '0', DI(12) => '0', DI(11) => '0', DI(10) => '0', DI(9) => '0', DI(8) => '0', DI(7) => '0', DI(6) => '0', DI(5) => '0', DI(4) => '0', DI(3) => '0', DI(2) => '0', DI(1) => '0', DI(0) => '0', DO(15 downto 0) => NLW_mmcm_adv_inst_DO_UNCONNECTED(15 downto 0), DRDY => NLW_mmcm_adv_inst_DRDY_UNCONNECTED, DWE => '0', LOCKED => locked, PSCLK => '0', PSDONE => NLW_mmcm_adv_inst_PSDONE_UNCONNECTED, PSEN => '0', PSINCDEC => '0', PWRDWN => '0', RST => '0' ); end STRUCTURE; library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; entity clk_adc is port ( clk_in1_p : in STD_LOGIC; clk_in1_n : in STD_LOGIC; clk_250Mhz : out STD_LOGIC; locked : out STD_LOGIC ); attribute NotValidForBitStream : boolean; attribute NotValidForBitStream of clk_adc : entity is true; attribute core_generation_info : string; attribute core_generation_info of clk_adc : entity is "clk_adc,clk_wiz_v5_1,{component_name=clk_adc,use_phase_alignment=true,use_min_o_jitter=false,use_max_i_jitter=false,use_dyn_phase_shift=false,use_inclk_switchover=false,use_dyn_reconfig=false,enable_axi=0,feedback_source=FDBK_AUTO,PRIMITIVE=MMCM,num_out_clk=1,clkin1_period=4.0,clkin2_period=10.0,use_power_down=false,use_reset=false,use_locked=true,use_inclk_stopped=false,feedback_type=SINGLE,CLOCK_MGR_TYPE=NA,manual_override=false}"; end clk_adc; architecture STRUCTURE of clk_adc is begin U0: entity work.clk_adcclk_adc_clk_wiz port map ( clk_250Mhz => clk_250Mhz, clk_in1_n => clk_in1_n, clk_in1_p => clk_in1_p, locked => locked ); end STRUCTURE;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2013, Aeroflex Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ---------------------------------------------------------------------------- -- Entity: phy -- File: phy.vhd -- Description: Simulation model of an Ethernet PHY -- Author: Marko Isomaki ------------------------------------------------------------------------------ -- pragma translate_off library ieee; library grlib; use ieee.std_logic_1164.all; use grlib.stdlib.all; entity phy is generic( address : integer range 0 to 31 := 0; extended_regs : integer range 0 to 1 := 1; aneg : integer range 0 to 1 := 1; base100_t4 : integer range 0 to 1 := 0; base100_x_fd : integer range 0 to 1 := 1; base100_x_hd : integer range 0 to 1 := 1; fd_10 : integer range 0 to 1 := 1; hd_10 : integer range 0 to 1 := 1; base100_t2_fd : integer range 0 to 1 := 1; base100_t2_hd : integer range 0 to 1 := 1; base1000_x_fd : integer range 0 to 1 := 0; base1000_x_hd : integer range 0 to 1 := 0; base1000_t_fd : integer range 0 to 1 := 1; base1000_t_hd : integer range 0 to 1 := 1; rmii : integer range 0 to 1 := 0; rgmii : integer range 0 to 1 := 0 ); port( rstn : in std_logic; mdio : inout std_logic; tx_clk : out std_logic; rx_clk : out std_logic; rxd : out std_logic_vector(7 downto 0); rx_dv : out std_logic; rx_er : out std_logic; rx_col : out std_logic; rx_crs : out std_logic; txd : in std_logic_vector(7 downto 0); tx_en : in std_logic; tx_er : in std_logic; mdc : in std_logic; gtx_clk : in std_logic ); end; architecture behavioral of phy is type mdio_state_type is (idle, start_of_frame, start_of_frame2, op, phyad, regad, ta, rdata, wdata); type ctrl_reg_type is record reset : std_ulogic; loopback : std_ulogic; speedsel : std_logic_vector(1 downto 0); anegen : std_ulogic; powerdown : std_ulogic; isolate : std_ulogic; restartaneg : std_ulogic; duplexmode : std_ulogic; coltest : std_ulogic; end record; type status_reg_type is record base100_t4 : std_ulogic; base100_x_fd : std_ulogic; base100_x_hd : std_ulogic; fd_10 : std_ulogic; hd_10 : std_ulogic; base100_t2_fd : std_ulogic; base100_t2_hd : std_ulogic; extstat : std_ulogic; mfpreamblesup : std_ulogic; anegcmpt : std_ulogic; remfault : std_ulogic; anegability : std_ulogic; linkstat : std_ulogic; jabdetect : std_ulogic; extcap : std_ulogic; end record; type aneg_ab_type is record next_page : std_ulogic; remote_fault : std_ulogic; tech_ability : std_logic_vector(7 downto 0); selector : std_logic_vector(4 downto 0); end record; type aneg_exp_type is record par_detct_flt : std_ulogic; lp_np_able : std_ulogic; np_able : std_ulogic; page_rx : std_ulogic; lp_aneg_able : std_ulogic; end record; type aneg_nextpage_type is record next_page : std_ulogic; message_page : std_ulogic; ack2 : std_ulogic; toggle : std_ulogic; message : std_logic_vector(10 downto 0); end record; type mst_slv_ctrl_type is record tmode : std_logic_vector(2 downto 0); manualcfgen : std_ulogic; cfgval : std_ulogic; porttype : std_ulogic; base1000_t_fd : std_ulogic; base1000_t_hd : std_ulogic; end record; type mst_slv_status_type is record cfgfault : std_ulogic; cfgres : std_ulogic; locrxstate : std_ulogic; remrxstate : std_ulogic; lpbase1000_t_fd : std_ulogic; lpbase1000_t_hd : std_ulogic; idlerrcnt : std_logic_vector(7 downto 0); end record; type extended_status_reg_type is record base1000_x_fd : std_ulogic; base1000_x_hd : std_ulogic; base1000_t_fd : std_ulogic; base1000_t_hd : std_ulogic; end record; type reg_type is record state : mdio_state_type; cnt : integer; op : std_logic_vector(1 downto 0); phyad : std_logic_vector(4 downto 0); regad : std_logic_vector(4 downto 0); wr : std_ulogic; regtmp : std_logic_vector(15 downto 0); -- MII management registers ctrl : ctrl_reg_type; status : status_reg_type; anegadv : aneg_ab_type; aneglp : aneg_ab_type; anegexp : aneg_exp_type; anegnptx : aneg_nextpage_type; anegnplp : aneg_nextpage_type; mstslvctrl : mst_slv_ctrl_type; mstslvstat : mst_slv_status_type; extstatus : extended_status_reg_type; rstcnt : integer; anegcnt : integer; end record; signal r, rin : reg_type; signal int_clk : std_ulogic := '0'; signal clkslow : std_ulogic := '0'; signal rcnt : integer; signal anegact : std_ulogic; begin --mdio signal pull-up int_clk <= not int_clk after 10 ns when rmii = 1 else not int_clk after 4 ns when r.ctrl.speedsel = "01" else not int_clk after 20 ns when r.ctrl.speedsel = "10" else not int_clk after 200 ns when r.ctrl.speedsel = "00"; clkslow <= not clkslow after 20 ns when r.ctrl.speedsel = "10" else not clkslow after 200 ns; -- rstdelay : process -- begin -- loop -- rstd <= '0'; -- while r.ctrl.reset /= '1' loop -- wait on r.ctrl.reset; -- end loop; -- rstd <= '1'; -- while rstn = '0' loop -- wait on rstn; -- end loop; -- wait on rstn for 3 us; -- rstd <= '0'; -- wait on rstn until r.ctrl.reset = '0' for 5 us; -- end loop; -- end process; anegproc : process is begin loop anegact <= '0'; while rstn /= '1' loop wait on rstn; end loop; while rstn = '1' loop if r.ctrl.anegen = '0' then anegact <= '0'; wait on rstn, r.ctrl.anegen, r.ctrl.restartaneg; else if r.ctrl.restartaneg = '1' then anegact <= '1'; wait on rstn, r.ctrl.restartaneg, r.ctrl.anegen for 2 us; anegact <= '0'; wait on rstn, r.ctrl.anegen until r.ctrl.restartaneg = '0'; if (rstn and r.ctrl.anegen) = '1' then wait on rstn, r.ctrl.anegen, r.ctrl.restartaneg; end if; else anegact <= '0'; wait on rstn, r.ctrl.restartaneg, r.ctrl.anegen; end if; end if; end loop; end loop; end process; mdiocomb : process(rstn, r, anegact, mdio) is variable v : reg_type; begin v := r; if anegact = '0' then v.ctrl.restartaneg := '0'; end if; case r.state is when idle => mdio <= 'Z'; if to_X01(mdio) = '1' then v.cnt := v.cnt + 1; if v.cnt = 31 then v.state := start_of_frame; v.cnt := 0; end if; else v.cnt := 0; end if; when start_of_frame => if to_X01(mdio) = '0' then v.state := start_of_frame2; elsif to_X01(mdio) /= '1' then v.state := idle; end if; when start_of_frame2 => if to_X01(mdio) = '1' then v.state := op; else v.state := idle; end if; when op => v.cnt := v.cnt + 1; v.op := r.op(0) & to_X01(mdio); if r.cnt = 1 then if (v.op = "01") or (v.op = "10") then v.state := phyad; v.cnt := 0; else v.state := idle; v.cnt := 0; end if; end if; when phyad => v.phyad := r.phyad(3 downto 0) & to_X01(mdio); v.cnt := v.cnt + 1; if r.cnt = 4 then v.state := regad; v.cnt := 0; end if; when regad => v.regad := r.regad(3 downto 0) & to_X01(mdio); v.cnt := v.cnt + 1; if r.cnt = 4 then v.cnt := 0; if conv_integer(r.phyad) = address then v.state := ta; else v.state := idle; end if; end if; when ta => v.cnt := r.cnt + 1; if r.cnt = 0 then if (r.op = "01") and to_X01(mdio) /= '1' then v.cnt := 0; v.state := idle; end if; else if r.op = "10" then mdio <= '0'; v.cnt := 0; v.state := rdata; case r.regad is when "00000" => --ctrl (basic) v.regtmp := r.ctrl.reset & r.ctrl.loopback & r.ctrl.speedsel(1) & r.ctrl.anegen & r.ctrl.powerdown & r.ctrl.isolate & r.ctrl.restartaneg & r.ctrl.duplexmode & r.ctrl.coltest & r.ctrl.speedsel(0) & "000000"; when "00001" => --statuc (basic) v.regtmp := r.status.base100_t4 & r.status.base100_x_fd & r.status.base100_x_hd & r.status.fd_10 & r.status.hd_10 & r.status.base100_t2_fd & r.status.base100_t2_hd & r.status.extstat & '0' & r.status.mfpreamblesup & r.status.anegcmpt & r.status.remfault & r.status.anegability & r.status.linkstat & r.status.jabdetect & r.status.extcap; when "00010" => --PHY ID (extended) if extended_regs = 1 then v.regtmp := X"BBCD"; else v.cnt := 0; v.state := idle; end if; when "00011" => --PHY ID (extended) if extended_regs = 1 then v.regtmp := X"9C83"; else v.cnt := 0; v.state := idle; end if; when "00100" => --Auto-neg adv. (extended) if extended_regs = 1 then v.regtmp := r.anegadv.next_page & '0' & r.anegadv.remote_fault & r.anegadv.tech_ability & r.anegadv.selector; else v.cnt := 0; v.state := idle; end if; when "00101" => --Auto-neg link partner ability (extended) if extended_regs = 1 then v.regtmp := r.aneglp.next_page & '0' & r.aneglp.remote_fault & r.aneglp.tech_ability & r.aneglp.selector; else v.cnt := 0; v.state := idle; end if; when "00110" => --Auto-neg expansion (extended) if extended_regs = 1 then v.regtmp := "00000000000" & r.anegexp.par_detct_flt & r.anegexp.lp_np_able & r.anegexp.np_able & r.anegexp.page_rx & r.anegexp.lp_aneg_able; else v.cnt := 0; v.state := idle; end if; when "00111" => --Auto-neg next page (extended) if extended_regs = 1 then v.regtmp := r.anegnptx.next_page & '0' & r.anegnptx.message_page & r.anegnptx.ack2 & r.anegnptx.toggle & r.anegnptx.message; else v.cnt := 0; v.state := idle; end if; when "01000" => --Auto-neg link partner received next page (extended) if extended_regs = 1 then v.regtmp := r.anegnplp.next_page & '0' & r.anegnplp.message_page & r.anegnplp.ack2 & r.anegnplp.toggle & r.anegnplp.message; else v.cnt := 0; v.state := idle; end if; when "01001" => --Master-slave control (extended) if extended_regs = 1 then v.regtmp := r.mstslvctrl.tmode & r.mstslvctrl.manualcfgen & r.mstslvctrl.cfgval & r.mstslvctrl.porttype & r.mstslvctrl.base1000_t_fd & r.mstslvctrl.base1000_t_hd & "00000000"; else v.cnt := 0; v.state := idle; end if; when "01010" => --Master-slave status (extended) if extended_regs = 1 then v.regtmp := r.mstslvstat.cfgfault & r.mstslvstat.cfgres & r.mstslvstat.locrxstate & r.mstslvstat.remrxstate & r.mstslvstat.lpbase1000_t_fd & r.mstslvstat.lpbase1000_t_hd & "00" & r.mstslvstat.idlerrcnt; else v.cnt := 0; v.state := idle; end if; when "01111" => if (base1000_x_fd = 1) or (base1000_x_hd = 1) or (base1000_t_fd = 1) or (base1000_t_hd = 1) then v.regtmp := r.extstatus.base1000_x_fd & r.extstatus.base1000_x_hd & r.extstatus.base1000_t_fd & r.extstatus.base1000_t_hd & X"000"; else v.regtmp := (others => '0'); end if; when others => --PHY shall not drive MDIO when unimplemented registers --are accessed v.cnt := 0; v.state := idle; v.regtmp := (others => '0'); end case; if r.ctrl.reset = '1' then if r.regad = "00000" then v.regtmp := X"8000"; else v.regtmp := X"0000"; end if; end if; else if to_X01(mdio) /= '0'then v.cnt := 0; v.state := idle; else v.cnt := 0; v.state := wdata; end if; end if; end if; when rdata => v.cnt := r.cnt + 1; mdio <= r.regtmp(15-r.cnt); if r.cnt = 15 then v.state := idle; v.cnt := 0; end if; when wdata => v.cnt := r.cnt + 1; v.regtmp := r.regtmp(14 downto 0) & to_X01(mdio); if r.cnt = 15 then v.state := idle; v.cnt := 0; if r.ctrl.reset = '0' then case r.regad is when "00000" => v.ctrl.reset := v.regtmp(15); v.ctrl.loopback := v.regtmp(14); v.ctrl.speedsel(1) := v.regtmp(13); v.ctrl.anegen := v.regtmp(12); v.ctrl.powerdown := v.regtmp(11); v.ctrl.isolate := v.regtmp(10); v.ctrl.restartaneg := v.regtmp(9); v.ctrl.duplexmode := v.regtmp(8); v.ctrl.coltest := v.regtmp(7); v.ctrl.speedsel(0) := v.regtmp(6); when "00100" => if extended_regs = 1 then v.anegadv.remote_fault := r.regtmp(13); v.anegadv.tech_ability := r.regtmp(12 downto 5); v.anegadv.selector := r.regtmp(4 downto 0); end if; when "00111" => if extended_regs = 1 then v.anegnptx.next_page := r.regtmp(15); v.anegnptx.message_page := r.regtmp(13); v.anegnptx.ack2 := r.regtmp(12); v.anegnptx.message := r.regtmp(10 downto 0); end if; when "01001" => if extended_regs = 1 then v.mstslvctrl.tmode := r.regtmp(15 downto 13); v.mstslvctrl.manualcfgen := r.regtmp(12); v.mstslvctrl.cfgval := r.regtmp(11); v.mstslvctrl.porttype := r.regtmp(10); v.mstslvctrl.base1000_t_fd := r.regtmp(9); v.mstslvctrl.base1000_t_hd := r.regtmp(8); end if; when others => --no writable bits for other regs null; end case; end if; end if; when others => null; end case; if r.rstcnt > 19 then v.ctrl.reset := '0'; v.rstcnt := 0; else v.rstcnt := r.rstcnt + 1; end if; if (v.ctrl.reset and not r.ctrl.reset) = '1' then v.rstcnt := 0; end if; if r.ctrl.anegen = '1' then if r.anegcnt < 10 then v.anegcnt := r.anegcnt + 1; else v.status.anegcmpt := '1'; if (base1000_x_fd = 1) or (base1000_x_hd = 1) or (r.mstslvctrl.base1000_t_fd = '1') or (r.mstslvctrl.base1000_t_hd = '1') then v.ctrl.speedsel(1 downto 0) := "01"; elsif (r.anegadv.tech_ability(4) = '1') or (r.anegadv.tech_ability(3) = '1') or (r.anegadv.tech_ability(2) = '1') or (base100_t2_fd = 1) or (base100_t2_hd = 1) then v.ctrl.speedsel(1 downto 0) := "10"; else v.ctrl.speedsel(1 downto 0) := "00"; end if; if ((base1000_x_fd = 1) or (r.mstslvctrl.base1000_t_fd = '1')) or (((base100_t2_fd = 1) or (r.anegadv.tech_ability(3) = '1')) and (r.mstslvctrl.base1000_t_hd = '0') and (base1000_x_hd = 0)) or ((r.anegadv.tech_ability(1) = '1') and (base100_t2_hd = 0) and (r.anegadv.tech_ability(4) = '0') and (r.anegadv.tech_ability(2) = '0')) then v.ctrl.duplexmode := '1'; else v.ctrl.duplexmode := '0'; end if; end if; end if; if r.ctrl.restartaneg = '1' then v.anegcnt := 0; v.status.anegcmpt := '0'; v.ctrl.restartaneg := '0'; end if; rin <= v; end process; reg : process(rstn, mdc) is begin if rising_edge(mdc) then r <= rin; end if; -- -- RESET DELAY -- if rstd = '1' then -- r.ctrl.reset <= '1'; -- else -- r.ctrl.reset <= '0'; -- end if; -- RESET if (r.ctrl.reset or not rstn) = '1' then r.ctrl.loopback <= '1'; r.anegcnt <= 0; if (base1000_x_hd = 1) or (base1000_x_fd = 1) or (base1000_t_hd = 1) or (base1000_t_fd = 1) then r.ctrl.speedsel <= "01"; elsif (base100_x_hd = 1) or (base100_t2_hd = 1) or (base100_x_fd = 1) or (base100_t2_fd = 1) or (base100_t4 = 1) then r.ctrl.speedsel <= "10"; else r.ctrl.speedsel <= "00"; end if; r.ctrl.anegen <= conv_std_logic(aneg = 1); r.ctrl.powerdown <= '0'; r.ctrl.isolate <= '0'; r.ctrl.restartaneg <= '0'; if (base100_x_hd = 0) and (hd_10 = 0) and (base100_t2_hd = 0) and (base1000_x_hd = 0) and (base1000_t_hd = 0) then r.ctrl.duplexmode <= '1'; else r.ctrl.duplexmode <= '0'; end if; r.ctrl.coltest <= '0'; r.status.base100_t4 <= conv_std_logic(base100_t4 = 1); r.status.base100_x_fd <= conv_std_logic(base100_x_fd = 1); r.status.base100_x_hd <= conv_std_logic(base100_x_hd = 1); r.status.fd_10 <= conv_std_logic(fd_10 = 1); r.status.hd_10 <= conv_std_logic(hd_10 = 1); r.status.base100_t2_fd <= conv_std_logic(base100_t2_fd = 1); r.status.base100_t2_hd <= conv_std_logic(base100_t2_hd = 1); r.status.extstat <= conv_std_logic((base1000_x_fd = 1) or (base1000_x_hd = 1) or (base1000_t_fd = 1) or (base1000_t_hd = 1)); r.status.mfpreamblesup <= '0'; r.status.anegcmpt <= '0'; r.status.remfault <= '0'; r.status.anegability <= conv_std_logic(aneg = 1); r.status.linkstat <= '0'; r.status.jabdetect <= '0'; r.status.extcap <= conv_std_logic(extended_regs = 1); r.anegadv.next_page <= '0'; r.anegadv.remote_fault <= '0'; r.anegadv.tech_ability <= "000" & conv_std_logic(base100_t4 = 1) & conv_std_logic(base100_x_fd = 1) & conv_std_logic(base100_x_hd = 1) & conv_std_logic(fd_10 = 1) & conv_std_logic(hd_10 = 1); r.anegadv.selector <= "00001"; r.aneglp.next_page <= '0'; r.aneglp.remote_fault <= '0'; r.aneglp.tech_ability <= "000" & conv_std_logic(base100_t4 = 1) & conv_std_logic(base100_x_fd = 1) & conv_std_logic(base100_x_hd = 1) & conv_std_logic(fd_10 = 1) & conv_std_logic(hd_10 = 1); r.aneglp.selector <= "00001"; r.anegexp.par_detct_flt <= '0'; r.anegexp.lp_np_able <= '0'; r.anegexp.np_able <= '0'; r.anegexp.page_rx <= '0'; r.anegexp.lp_aneg_able <= '0'; r.anegnptx.next_page <= '0'; r.anegnptx.message_page <= '1'; r.anegnptx.ack2 <= '0'; r.anegnptx.toggle <= '0'; r.anegnptx.message <= "00000000001"; r.anegnplp.next_page <= '0'; r.anegnplp.message_page <= '1'; r.anegnplp.ack2 <= '0'; r.anegnplp.toggle <= '0'; r.anegnplp.message <= "00000000001"; r.mstslvctrl.tmode <= (others => '0'); r.mstslvctrl.manualcfgen <= '0'; r.mstslvctrl.cfgval <= '0'; r.mstslvctrl.porttype <= '0'; r.mstslvctrl.base1000_t_fd <= conv_std_logic(base1000_t_fd = 1); r.mstslvctrl.base1000_t_hd <= conv_std_logic(base1000_t_fd = 1); r.mstslvstat.cfgfault <= '0'; r.mstslvstat.cfgres <= '1'; r.mstslvstat.locrxstate <= '1'; r.mstslvstat.remrxstate <= '1'; r.mstslvstat.lpbase1000_t_fd <= conv_std_logic(base1000_t_fd = 1); r.mstslvstat.lpbase1000_t_hd <= conv_std_logic(base1000_t_fd = 1); r.mstslvstat.idlerrcnt <= (others => '0'); r.extstatus.base1000_x_fd <= conv_std_logic(base1000_x_fd = 1); r.extstatus.base1000_x_hd <= conv_std_logic(base1000_x_hd = 1); r.extstatus.base1000_t_fd <= conv_std_logic(base1000_t_fd = 1); r.extstatus.base1000_t_hd <= conv_std_logic(base1000_t_hd = 1); end if; if rstn = '0' then r.cnt <= 0; r.state <= idle; r.rstcnt <= 0; r.ctrl.reset <= '1'; end if; end process; loopback_sel : process(r.ctrl.loopback, int_clk, gtx_clk, r.ctrl.speedsel, txd, tx_en) is begin if r.ctrl.loopback = '1' then if rmii = 0 then rx_col <= '0'; rx_crs <= tx_en; rx_dv <= tx_en; rx_er <= tx_er; rxd <= txd; if r.ctrl.speedsel /= "01" then rx_clk <= int_clk; tx_clk <= int_clk; else rx_clk <= gtx_clk; tx_clk <= clkslow; end if; else rx_dv <= '1'; rx_er <= '1'; --unused should not affect anything rx_col <= '0'; rx_crs <= tx_en; if tx_en = '0' then rxd(1 downto 0) <= "00"; else rxd(1 downto 0) <= txd(1 downto 0); end if; if rgmii = 1 then if (gtx_clk = '1' and tx_en = '0') then rxd(3 downto 0) <= r.ctrl.duplexmode & r.ctrl.speedsel & r.status.linkstat; end if; end if; rx_clk <= '0'; tx_clk <= '0'; end if; else rx_col <= '0'; rx_crs <= '0'; rx_dv <= '0'; rx_er <= '0'; rxd <= (others => '0'); if rgmii = 1 then if (gtx_clk = '1') then rxd(3 downto 0) <= r.ctrl.duplexmode & r.ctrl.speedsel & r.status.linkstat; end if; end if; if rmii = 0 then if r.ctrl.speedsel /= "01" then rx_clk <= int_clk; tx_clk <= int_clk after 3 ns; else rx_clk <= gtx_clk; tx_clk <= clkslow; end if; else rx_clk <= int_clk; tx_clk <= int_clk after 3 ns; end if; end if; end process; end; -- pragma translate_on
-- (c) Copyright 1995-2017 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:module_ref:Counter10bit:1.0 -- IP Revision: 1 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY RAT_Counter10bit_0_0 IS PORT ( Din : IN STD_LOGIC_VECTOR(0 TO 9); LOAD : IN STD_LOGIC; INC : IN STD_LOGIC; RESET : IN STD_LOGIC; CLK : IN STD_LOGIC; COUNT : OUT STD_LOGIC_VECTOR(0 TO 9) ); END RAT_Counter10bit_0_0; ARCHITECTURE RAT_Counter10bit_0_0_arch OF RAT_Counter10bit_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF RAT_Counter10bit_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT Counter10bit IS PORT ( Din : IN STD_LOGIC_VECTOR(0 TO 9); LOAD : IN STD_LOGIC; INC : IN STD_LOGIC; RESET : IN STD_LOGIC; CLK : IN STD_LOGIC; COUNT : OUT STD_LOGIC_VECTOR(0 TO 9) ); END COMPONENT Counter10bit; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF RESET: SIGNAL IS "xilinx.com:signal:reset:1.0 RESET RST"; ATTRIBUTE X_INTERFACE_INFO OF CLK: SIGNAL IS "xilinx.com:signal:clock:1.0 CLK CLK"; BEGIN U0 : Counter10bit PORT MAP ( Din => Din, LOAD => LOAD, INC => INC, RESET => RESET, CLK => CLK, COUNT => COUNT ); END RAT_Counter10bit_0_0_arch;
-- (c) Copyright 1995-2017 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:module_ref:Counter10bit:1.0 -- IP Revision: 1 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY RAT_Counter10bit_0_0 IS PORT ( Din : IN STD_LOGIC_VECTOR(0 TO 9); LOAD : IN STD_LOGIC; INC : IN STD_LOGIC; RESET : IN STD_LOGIC; CLK : IN STD_LOGIC; COUNT : OUT STD_LOGIC_VECTOR(0 TO 9) ); END RAT_Counter10bit_0_0; ARCHITECTURE RAT_Counter10bit_0_0_arch OF RAT_Counter10bit_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF RAT_Counter10bit_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT Counter10bit IS PORT ( Din : IN STD_LOGIC_VECTOR(0 TO 9); LOAD : IN STD_LOGIC; INC : IN STD_LOGIC; RESET : IN STD_LOGIC; CLK : IN STD_LOGIC; COUNT : OUT STD_LOGIC_VECTOR(0 TO 9) ); END COMPONENT Counter10bit; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF RESET: SIGNAL IS "xilinx.com:signal:reset:1.0 RESET RST"; ATTRIBUTE X_INTERFACE_INFO OF CLK: SIGNAL IS "xilinx.com:signal:clock:1.0 CLK CLK"; BEGIN U0 : Counter10bit PORT MAP ( Din => Din, LOAD => LOAD, INC => INC, RESET => RESET, CLK => CLK, COUNT => COUNT ); END RAT_Counter10bit_0_0_arch;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
-- (C) 1992-2014 Altera Corporation. All rights reserved. -- Your use of Altera Corporation's design tools, logic functions and other -- software and tools, and its AMPP partner logic functions, and any output -- files any of the foregoing (including device programming or simulation -- files), and any associated documentation or information are expressly subject -- to the terms and conditions of the Altera Program License Subscription -- Agreement, Altera MegaCore Function License Agreement, or other applicable -- license agreement, including, without limitation, that your use is for the -- sole purpose of programming logic devices manufactured by Altera and sold by -- Altera or its authorized distributors. Please refer to the applicable -- agreement for further details. LIBRARY ieee; LIBRARY work; USE ieee.std_logic_1164.all; USE ieee.std_logic_signed.all; USE ieee.std_logic_arith.all; --*************************************************** --*** *** --*** FLOATING POINT CORE LIBRARY *** --*** *** --*** FP_POS51.VHD *** --*** *** --*** Function: 5 Bit Count Leading Zeros *** --*** Component *** --*** *** --*** 22/12/09 ML *** --*** *** --*** (c) 2009 Altera Corporation *** --*** *** --*** Change History *** --*** *** --*** *** --*** *** --*************************************************** ENTITY fp_pos51 IS GENERIC (start : integer := 10); PORT ( ingroup : IN STD_LOGIC_VECTOR (6 DOWNTO 1); position : OUT STD_LOGIC_VECTOR (5 DOWNTO 1) ); END fp_pos51; ARCHITECTURE sss of fp_pos51 IS BEGIN ptab: PROCESS (ingroup) BEGIN CASE ingroup IS WHEN "000000" => position <= conv_std_logic_vector(0,5); WHEN "000001" => position <= conv_std_logic_vector(start+5,5); WHEN "000010" => position <= conv_std_logic_vector(start+4,5); WHEN "000011" => position <= conv_std_logic_vector(start+4,5); WHEN "000100" => position <= conv_std_logic_vector(start+3,5); WHEN "000101" => position <= conv_std_logic_vector(start+3,5); WHEN "000110" => position <= conv_std_logic_vector(start+3,5); WHEN "000111" => position <= conv_std_logic_vector(start+3,5); WHEN "001000" => position <= conv_std_logic_vector(start+2,5); WHEN "001001" => position <= conv_std_logic_vector(start+2,5); WHEN "001010" => position <= conv_std_logic_vector(start+2,5); WHEN "001011" => position <= conv_std_logic_vector(start+2,5); WHEN "001100" => position <= conv_std_logic_vector(start+2,5); WHEN "001101" => position <= conv_std_logic_vector(start+2,5); WHEN "001110" => position <= conv_std_logic_vector(start+2,5); WHEN "001111" => position <= conv_std_logic_vector(start+2,5); WHEN "010000" => position <= conv_std_logic_vector(start+1,5); WHEN "010001" => position <= conv_std_logic_vector(start+1,5); WHEN "010010" => position <= conv_std_logic_vector(start+1,5); WHEN "010011" => position <= conv_std_logic_vector(start+1,5); WHEN "010100" => position <= conv_std_logic_vector(start+1,5); WHEN "010101" => position <= conv_std_logic_vector(start+1,5); WHEN "010110" => position <= conv_std_logic_vector(start+1,5); WHEN "010111" => position <= conv_std_logic_vector(start+1,5); WHEN "011000" => position <= conv_std_logic_vector(start+1,5); WHEN "011001" => position <= conv_std_logic_vector(start+1,5); WHEN "011010" => position <= conv_std_logic_vector(start+1,5); WHEN "011011" => position <= conv_std_logic_vector(start+1,5); WHEN "011100" => position <= conv_std_logic_vector(start+1,5); WHEN "011101" => position <= conv_std_logic_vector(start+1,5); WHEN "011110" => position <= conv_std_logic_vector(start+1,5); WHEN "011111" => position <= conv_std_logic_vector(start+1,5); WHEN "100000" => position <= conv_std_logic_vector(start,5); WHEN "100001" => position <= conv_std_logic_vector(start,5); WHEN "100010" => position <= conv_std_logic_vector(start,5); WHEN "100011" => position <= conv_std_logic_vector(start,5); WHEN "100100" => position <= conv_std_logic_vector(start,5); WHEN "100101" => position <= conv_std_logic_vector(start,5); WHEN "100110" => position <= conv_std_logic_vector(start,5); WHEN "100111" => position <= conv_std_logic_vector(start,5); WHEN "101000" => position <= conv_std_logic_vector(start,5); WHEN "101001" => position <= conv_std_logic_vector(start,5); WHEN "101010" => position <= conv_std_logic_vector(start,5); WHEN "101011" => position <= conv_std_logic_vector(start,5); WHEN "101100" => position <= conv_std_logic_vector(start,5); WHEN "101101" => position <= conv_std_logic_vector(start,5); WHEN "101110" => position <= conv_std_logic_vector(start,5); WHEN "101111" => position <= conv_std_logic_vector(start,5); WHEN "110000" => position <= conv_std_logic_vector(start,5); WHEN "110001" => position <= conv_std_logic_vector(start,5); WHEN "110010" => position <= conv_std_logic_vector(start,5); WHEN "110011" => position <= conv_std_logic_vector(start,5); WHEN "110100" => position <= conv_std_logic_vector(start,5); WHEN "110101" => position <= conv_std_logic_vector(start,5); WHEN "110110" => position <= conv_std_logic_vector(start,5); WHEN "110111" => position <= conv_std_logic_vector(start,5); WHEN "111000" => position <= conv_std_logic_vector(start,5); WHEN "111001" => position <= conv_std_logic_vector(start,5); WHEN "111010" => position <= conv_std_logic_vector(start,5); WHEN "111011" => position <= conv_std_logic_vector(start,5); WHEN "111100" => position <= conv_std_logic_vector(start,5); WHEN "111101" => position <= conv_std_logic_vector(start,5); WHEN "111110" => position <= conv_std_logic_vector(start,5); WHEN "111111" => position <= conv_std_logic_vector(start,5); WHEN others => position <= conv_std_logic_vector(0,5); END CASE; END PROCESS; END sss;
package pack is type int_vector is array (natural range <>) of natural; function spread_ints (x : integer) return int_vector; end package; package body pack is function spread_ints (x : integer) return int_vector is variable r : int_vector(1 to 5); begin for i in 1 to 5 loop r(i) := x; end loop; return r; end function; end package body; ------------------------------------------------------------------------------- use work.pack.all; entity sub is port ( o1 : out int_vector(1 to 5); i1 : in integer; i2 : in int_vector(1 to 5) ); end entity; architecture test of sub is begin p1a: process is begin assert i1 = 0; assert i2 = (1 to 5 => 0); o1(1 to 3) <= (1, 2, 3); wait for 1 ns; assert i1 = 150; assert i2 = (1 to 5 => 42); o1(1) <= 10; wait; end process; p1b: process is begin o1(4 to 5) <= (4, 5); wait; end process; end architecture; ------------------------------------------------------------------------------- entity conv6 is end entity; use work.pack.all; architecture test of conv6 is signal x : integer; signal y : int_vector(1 to 5); signal q : natural; function sum_ints(v : in int_vector) return integer is variable result : integer := 0; begin for i in v'range loop result := result + v(i); end loop; return result; end function; begin uut: entity work.sub port map ( sum_ints(o1) => x, i1 => sum_ints(y), i2 => spread_ints(q) ); p2: process is begin assert x = 0; y <= (10, 20, 30, 40, 50); q <= 42; wait for 1 ns; assert x = 15; wait for 1 ns; assert x = 24; wait; end process; end architecture;
-------------------------------------------------------------------------------- -- (c) Copyright 2010 - 2013 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -------------------------------------------------------------------------------- -- Description: -- This is an example testbench for the DDS Compiler IP core. -- The testbench has been generated by Vivado to accompany the IP core -- instance you have generated. -- -- This testbench is for demonstration purposes only. See note below for -- instructions on how to use it with your core. -- -- See the DDS Compiler product guide for further information -- about this core. -- -------------------------------------------------------------------------------- -- Using this testbench -- -- This testbench instantiates your generated DDS Compiler core -- instance named "dds". -- -- Use Vivado's Run Simulation flow to run this testbench. See the Vivado -- documentation for details. -------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ieee.math_real.all; entity tb_dds is end tb_dds; architecture tb of tb_dds is ----------------------------------------------------------------------- -- Timing constants ----------------------------------------------------------------------- constant CLOCK_PERIOD : time := 100 ns; constant T_HOLD : time := 10 ns; constant T_STROBE : time := CLOCK_PERIOD - (1 ns); ----------------------------------------------------------------------- -- DUT input signals ----------------------------------------------------------------------- -- General inputs signal aclk : std_logic := '0'; -- the master clock -- Phase slave channel signals signal s_axis_phase_tvalid : std_logic := '0'; -- payload is valid signal s_axis_phase_tdata : std_logic_vector(23 downto 0) := (others => '0'); -- data payload -- Data master channel signals signal m_axis_data_tvalid : std_logic := '0'; -- payload is valid signal m_axis_data_tdata : std_logic_vector(31 downto 0) := (others => '0'); -- data payload ----------------------------------------------------------------------- -- Aliases for AXI channel TDATA and TUSER fields -- These are a convenience for viewing data in a simulator waveform viewer. -- If using ModelSim or Questa, add "-voptargs=+acc=n" to the vsim command -- to prevent the simulator optimizing away these signals. ----------------------------------------------------------------------- -- Phase slave channel alias signals signal s_axis_phase_tdata_inc : std_logic_vector(21 downto 0) := (others => '0'); -- Data master channel alias signals signal m_axis_data_tdata_cosine : std_logic_vector(15 downto 0) := (others => '0'); signal m_axis_data_tdata_sine : std_logic_vector(15 downto 0) := (others => '0'); signal end_of_simulation : boolean := false; begin ----------------------------------------------------------------------- -- Instantiate the DUT ----------------------------------------------------------------------- dut : entity work.dds port map ( aclk => aclk ,s_axis_phase_tvalid => s_axis_phase_tvalid ,s_axis_phase_tdata => s_axis_phase_tdata ,m_axis_data_tvalid => m_axis_data_tvalid ,m_axis_data_tdata => m_axis_data_tdata ); ----------------------------------------------------------------------- -- Generate clock ----------------------------------------------------------------------- clock_gen : process begin aclk <= '0'; if (end_of_simulation) then wait; else wait for CLOCK_PERIOD; loop aclk <= '0'; wait for CLOCK_PERIOD/2; aclk <= '1'; wait for CLOCK_PERIOD/2; end loop; end if; end process clock_gen; ----------------------------------------------------------------------- -- Generate inputs ----------------------------------------------------------------------- stimuli : process begin -- Drive inputs T_HOLD time after rising edge of clock wait until rising_edge(aclk); wait for T_HOLD; -- Input a constant phase increment each cycle, and run for long enough to produce 5 periods of outputs for cycle in 0 to 159 loop s_axis_phase_tvalid <= '1'; s_axis_phase_tdata <= (others => '0'); -- set unused TDATA bits to zero s_axis_phase_tdata(21 downto 0) <= "0000000000000000000000"; -- constant phase increment wait for CLOCK_PERIOD; end loop; s_axis_phase_tvalid <= '0'; -- End of test end_of_simulation <= true; report "Not a real failure. Simulation finished successfully. Test completed successfully" severity failure; wait; end process stimuli; ----------------------------------------------------------------------- -- Check outputs ----------------------------------------------------------------------- check_outputs : process variable check_ok : boolean := true; begin -- Check outputs T_STROBE time after rising edge of clock wait until rising_edge(aclk); wait for T_STROBE; -- Do not check the output payload values, as this requires the behavioral model -- which would make this demonstration testbench unwieldy. -- Instead, check the protocol of the data master channel: -- check that the payload is valid (not X) when TVALID is high if m_axis_data_tvalid = '1' then if is_x(m_axis_data_tdata) then report "ERROR: m_axis_data_tdata is invalid when m_axis_data_tvalid is high" severity error; check_ok := false; end if; end if; assert check_ok report "ERROR: terminating test with failures." severity failure; end process check_outputs; ----------------------------------------------------------------------- -- Assign TDATA fields to aliases, for easy simulator waveform viewing ----------------------------------------------------------------------- -- Phase slave channel alias signals s_axis_phase_tdata_inc <= s_axis_phase_tdata(21 downto 0); -- Data master channel alias signals: update these only when they are valid m_axis_data_tdata_cosine <= m_axis_data_tdata(15 downto 0) when m_axis_data_tvalid = '1'; m_axis_data_tdata_sine <= m_axis_data_tdata(31 downto 16) when m_axis_data_tvalid = '1'; end tb;
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity lfsr is generic( BASE_ADDRESS: unsigned(23 downto 0) := x"000000" ); port( clk: in std_logic; res: in std_logic; address: in std_logic_vector(23 downto 0); data_mosi: in std_logic_vector(31 downto 0); data_miso: out std_logic_vector(31 downto 0); WR: in std_logic; RD: in std_logic; ack: out std_logic ); end entity lfsr; architecture lfsr_arch of lfsr is signal random_data: std_logic_vector(31 downto 0); signal cs: std_logic; begin process(address) is begin if unsigned(address) = BASE_ADDRESS then cs <= '1'; else cs <= '0'; end if; end process; -- base lfsr process(clk) is variable q: unsigned(31 downto 0); variable xored: std_logic; begin if rising_edge(clk) then if res = '1' then q := x"00000001"; else xored := q(0) xor q(1) xor q(21) xor q(31); q(31 downto 0) := q(30 downto 0) & xored; end if; end if; random_data <= std_logic_vector(q); end process; data_miso <= random_data when (RD = '1' and cs = '1') else (others => 'Z'); ack <= '1' when (RD = '1' and cs = '1') else '0'; end architecture;
-------------------------------------------------------------------------------- -- Company: <Mehatronika> -- Author: <Aleksandr Gudilko> -- Email: gudilkoalex@gmail.com -- File: BCD_DECODER.vhd -- File history: -- <1.3>: <02/04/2015>: <added thousands digit. Max 16383> -- <Revision number>: <Date>: <Comments> -- <Revision number>: <Date>: <Comments> -- -- Description: -- -- <Decode 13 bit input integer (max 9.999) into 4 digits in BCD code -- -- Targeted device: <Family::ProASIC3> <Die::M1A3P400> <Package::208 PQFP> -- -------------------------------------------------------------------------------- library IEEE; library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity bcd_4dig is Port ( number : in std_logic_vector (13 downto 0); thousands : out std_logic_vector (3 downto 0); hundreds : out std_logic_vector (3 downto 0); tens : out std_logic_vector (3 downto 0); ones : out std_logic_vector (3 downto 0) ); end bcd_4dig; architecture Behavioral of bcd_4dig is begin bin_to_bcd : process (number) -- Internal variable for storing bits variable shift : unsigned(29 downto 0); -- Alias for parts of shift register alias num is shift(13 downto 0); alias one is shift(17 downto 14); alias ten is shift(21 downto 18); alias hun is shift(25 downto 22); alias thous is shift(29 downto 26); begin -- Clear previous number and store new number in shift register num := unsigned(number); one := X"0"; ten := X"0"; hun := X"0"; thous := X"0"; -- Loop eight times for i in 1 to num'Length loop -- Check if any digit is greater than or equal to 5 if one >= 5 then one := one + 3; end if; if ten >= 5 then ten := ten + 3; end if; if hun >= 5 then hun := hun + 3; end if; if thous >= 5 then thous := thous + 3; end if; -- Shift entire register left once shift := shift_left(shift, 1); end loop; -- Push decimal numbers to output thousands <= std_logic_vector(thous); hundreds <= std_logic_vector(hun); tens <= std_logic_vector(ten); ones <= std_logic_vector(one); end process; end Behavioral;
library verilog; use verilog.vl_types.all; entity select3_32 is port( in1 : in vl_logic_vector(31 downto 0); in2 : in vl_logic_vector(31 downto 0); in3 : in vl_logic_vector(31 downto 0); choose : in vl_logic_vector(1 downto 0); \out\ : out vl_logic_vector(31 downto 0) ); end select3_32;
---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 19:25:45 11/23/2015 -- Design Name: -- Module Name: contatore_modulo_n - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity contatore_modulo_n is generic (n : natural := 4); Port ( clock : in STD_LOGIC; reset_n : in STD_LOGIC; count_en : in STD_LOGIC; up_down : in STD_LOGIC; mod_n : out STD_LOGIC); end contatore_modulo_n; architecture Behavioral of contatore_modulo_n is begin process (clock, reset_n, up_down) variable conteggio : natural range 0 to n-1 := 0; begin if (reset_n = '0') then mod_n <= '0'; if(up_down = '0') then conteggio := 0; else conteggio := n-1; end if; elsif (clock = '1' and clock'event) then if (count_en = '1') then if (up_down = '0') then if(conteggio = n-1) then mod_n <= '1'; conteggio := 0; else mod_n <= '0'; conteggio := conteggio + 1; end if; else if(conteggio = 0) then mod_n <= '1'; conteggio := n-1; else mod_n <= '0'; conteggio := conteggio - 1; end if; end if; end if; end if; end process; end Behavioral;
--! --! @file: exercise6_12.vhd --! @brief: Programmable Signal Generator --! @author: Antonio Gutierrez --! @date: 2013-10-28 --! --! -------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_all; -------------------------------------- entity programmable_signal_generator is generic (fclk: integer := 50_000_000;); -- clock frequency port ( clk: in std_logic; freq: in std_logic; sig_out: out std_logic); end entity programmable_signal_generator; -------------------------------------- architecture circuit of programmable_signal_generator is signal desired_freq: integer 0 to 10000; signal pulses: integer 0 to fclk / 1000; begin -- selecting the frequcny and the number of pulses required for that frequency proc1: process (freq) begin if (freq'event and freq = '1') then if (desired_freq = 10000) then desired_freq <= 1000; else desired_freq <= desired_freq + 1000; end if; pulses <= fclk / desired_freq; end if; end process proc1; -- outputing and counting the pulses proc: process (clk) variable count: integer 0 to fclk; variable output: std_logic := '0' begin if (clk'event and clk = '1') then count := count + 1; if (count = pulses) then count := 0; output := not output; end if; end if; sig_out <= output; end process proc; end architecture circuit; --------------------------------------
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1630.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s12b00x00p04n01i01630ent IS END c08s12b00x00p04n01i01630ent; ARCHITECTURE c08s12b00x00p04n01i01630arch OF c08s12b00x00p04n01i01630ent IS BEGIN TESTING: PROCESS variable i : integer := 0; procedure return_exp_check is begin i := 10; end; BEGIN return_exp_check; assert NOT(i = 10) report "***PASSED TEST: c08s12b00x00p04n01i01630" severity NOTE; assert (i = 10) report "***FAILED TEST: c08s12b00x00p04n01i01630 - A return statement is not required in a procedure body." severity ERROR; wait; END PROCESS TESTING; END c08s12b00x00p04n01i01630arch;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1630.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s12b00x00p04n01i01630ent IS END c08s12b00x00p04n01i01630ent; ARCHITECTURE c08s12b00x00p04n01i01630arch OF c08s12b00x00p04n01i01630ent IS BEGIN TESTING: PROCESS variable i : integer := 0; procedure return_exp_check is begin i := 10; end; BEGIN return_exp_check; assert NOT(i = 10) report "***PASSED TEST: c08s12b00x00p04n01i01630" severity NOTE; assert (i = 10) report "***FAILED TEST: c08s12b00x00p04n01i01630 - A return statement is not required in a procedure body." severity ERROR; wait; END PROCESS TESTING; END c08s12b00x00p04n01i01630arch;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc1630.vhd,v 1.2 2001-10-26 16:29:42 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c08s12b00x00p04n01i01630ent IS END c08s12b00x00p04n01i01630ent; ARCHITECTURE c08s12b00x00p04n01i01630arch OF c08s12b00x00p04n01i01630ent IS BEGIN TESTING: PROCESS variable i : integer := 0; procedure return_exp_check is begin i := 10; end; BEGIN return_exp_check; assert NOT(i = 10) report "***PASSED TEST: c08s12b00x00p04n01i01630" severity NOTE; assert (i = 10) report "***FAILED TEST: c08s12b00x00p04n01i01630 - A return statement is not required in a procedure body." severity ERROR; wait; END PROCESS TESTING; END c08s12b00x00p04n01i01630arch;
--############################################################################# -- Light8080 core demo 0 : IMSAI SCS1 monitor/assembler -- -- Designed for Cyclone II FPGA Starter Develoment Kit from terasIC. -- Runs IMSAI SCS1 monitor on serial port, using 4KB of internal RAM. -- Documentation for the monitor and Altera Quartus pin assignment files are -- included. -- -- All that's really needed to run the demo is the serial interface (2 pins), -- so this should be easy to adapt to any other dev board. --############################################################################# library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity c2sb_light8080_demo is port ( clk_50MHz : in std_logic; flash_addr : out std_logic_vector(21 downto 0); flash_data : in std_logic_vector(7 downto 0); flash_oe : out std_logic; flash_we : out std_logic; flash_reset : out std_logic; rxd : in std_logic; txd : out std_logic; switches : in std_logic_vector(9 downto 0); buttons : in std_logic_vector(3 downto 0); red_leds : out std_logic_vector(9 downto 0); green_leds : out std_logic_vector(7 downto 0) ); end c2sb_light8080_demo; architecture demo of c2sb_light8080_demo is component light8080 port ( addr_out : out std_logic_vector(15 downto 0); inta : out std_logic; inte : out std_logic; halt : out std_logic; intr : in std_logic; vma : out std_logic; io : out std_logic; rd : out std_logic; wr : out std_logic; data_in : in std_logic_vector(7 downto 0); data_out : out std_logic_vector(7 downto 0); clk : in std_logic; reset : in std_logic ); end component; -- Serial port, RX component rs232_rx port( rxd : IN std_logic; read_rx : IN std_logic; clk : IN std_logic; reset : IN std_logic; data_rx : OUT std_logic_vector(7 downto 0); rx_rdy : OUT std_logic ); end component; -- Serial port, TX component rs232_tx port( clk : IN std_logic; reset : IN std_logic; load : IN std_logic; data_i : IN std_logic_vector(7 downto 0); rdy : OUT std_logic; txd : OUT std_logic ); end component; --############################################################################## -- light8080 CPU system signals signal data_in : std_logic_vector(7 downto 0); signal vma : std_logic; signal rd : std_logic; signal wr : std_logic; signal io : std_logic; signal data_out : std_logic_vector(7 downto 0); signal addr : std_logic_vector(15 downto 0); signal inta : std_logic; signal inte : std_logic; signal intr : std_logic; signal halt : std_logic; signal reg_h : std_logic_vector(7 downto 0); signal reg_l : std_logic_vector(7 downto 0); signal io_q : std_logic; signal rd_q : std_logic; signal io_read : std_logic; signal io_write : std_logic; --############################################################################## -- RS232 signals signal rx_rdy : std_logic; signal tx_rdy : std_logic; signal rs232_data_rx : std_logic_vector(7 downto 0); signal rs232_status : std_logic_vector(7 downto 0); signal data_io_out : std_logic_vector(7 downto 0); signal io_port : std_logic_vector(7 downto 0); signal read_rx : std_logic; signal write_tx : std_logic; signal rom_addr : std_logic_vector(11 downto 0); type t_rom is array(0 to 4095) of std_logic_vector(7 downto 0); signal rom : t_rom := ( -- @begin_rom X"c3",X"40",X"00",X"c3",X"69",X"00",X"00",X"00", X"c3",X"87",X"0d",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"21",X"79",X"04",X"cd",X"7d",X"02",X"cd",X"11", X"01",X"21",X"ad",X"04",X"cd",X"7d",X"02",X"cd", X"11",X"01",X"21",X"27",X"0e",X"0e",X"4e",X"af", X"77",X"23",X"0d",X"c2",X"58",X"00",X"06",X"18", X"21",X"0f",X"0e",X"77",X"23",X"05",X"c2",X"63", X"00",X"31",X"b5",X"0e",X"cd",X"11",X"01",X"cd", X"82",X"00",X"23",X"7e",X"fe",X"3a",X"da",X"0e", X"05",X"cd",X"76",X"01",X"cd",X"2e",X"01",X"c3", X"69",X"00",X"21",X"ca",X"0e",X"22",X"77",X"0e", X"1e",X"02",X"cd",X"f7",X"00",X"78",X"fe",X"18", X"c2",X"99",X"00",X"cd",X"11",X"01",X"c3",X"82", X"00",X"fe",X"0d",X"c2",X"b4",X"00",X"7d",X"fe", X"ca",X"ca",X"82",X"00",X"36",X"0d",X"23",X"36", X"01",X"23",X"3e",X"1d",X"cd",X"e3",X"00",X"21", X"c9",X"0e",X"73",X"c9",X"fe",X"7f",X"c2",X"c9", X"00",X"3e",X"ca",X"bd",X"ca",X"8a",X"00",X"2b", X"1d",X"06",X"5f",X"cd",X"05",X"01",X"c3",X"8a", X"00",X"fe",X"20",X"da",X"8a",X"00",X"fe",X"7b", X"d2",X"8a",X"00",X"47",X"cd",X"05",X"01",X"70", X"3e",X"1b",X"bd",X"ca",X"c1",X"00",X"23",X"1c", X"c3",X"8a",X"00",X"bd",X"c8",X"36",X"20",X"23", X"c3",X"e3",X"00",X"db",X"20",X"e6",X"01",X"c0", X"db",X"21",X"e6",X"7f",X"fe",X"38",X"c9",X"db", X"20",X"2f",X"e6",X"01",X"ca",X"f7",X"00",X"db", X"21",X"e6",X"7f",X"47",X"c9",X"db",X"20",X"2f", X"e6",X"80",X"ca",X"05",X"01",X"78",X"d3",X"21", X"c9",X"06",X"0d",X"cd",X"05",X"01",X"06",X"0a", X"cd",X"05",X"01",X"06",X"7f",X"cd",X"05",X"01", X"cd",X"05",X"01",X"c9",X"cd",X"03",X"03",X"cd", X"11",X"01",X"2a",X"8d",X"0e",X"e9",X"11",X"c1", X"02",X"06",X"0b",X"3e",X"04",X"32",X"98",X"0e", X"cd",X"3f",X"01",X"c2",X"5d",X"04",X"e9",X"2a", X"77",X"0e",X"3a",X"98",X"0e",X"4f",X"cd",X"56", X"01",X"1a",X"6f",X"13",X"1a",X"67",X"c8",X"13", X"05",X"c2",X"3f",X"01",X"04",X"c9",X"1a",X"be", X"c2",X"62",X"01",X"23",X"13",X"0d",X"c2",X"56", X"01",X"c9",X"13",X"0d",X"c2",X"62",X"01",X"0c", X"c9",X"af",X"11",X"8d",X"0e",X"06",X"0c",X"1b", X"12",X"05",X"c2",X"6f",X"01",X"c9",X"cd",X"7d", X"01",X"da",X"5d",X"04",X"c9",X"21",X"00",X"00", X"22",X"8f",X"0e",X"22",X"79",X"0e",X"cd",X"69", X"01",X"21",X"c9",X"0e",X"23",X"7e",X"fe",X"20", X"3f",X"d0",X"c2",X"8c",X"01",X"22",X"99",X"0e", X"cd",X"66",X"09",X"3f",X"d0",X"fe",X"2f",X"c2", X"c7",X"01",X"11",X"79",X"0e",X"0e",X"05",X"23", X"7e",X"fe",X"2f",X"ca",X"b7",X"01",X"0d",X"fa", X"5d",X"04",X"12",X"13",X"c3",X"a7",X"01",X"3e", X"20",X"0d",X"fa",X"c2",X"01",X"12",X"13",X"c3", X"b9",X"01",X"cd",X"6d",X"09",X"3f",X"d0",X"11", X"81",X"0e",X"cd",X"ce",X"0b",X"78",X"fe",X"05", X"3f",X"d8",X"01",X"81",X"0e",X"cd",X"1e",X"02", X"d8",X"22",X"8d",X"0e",X"21",X"81",X"0e",X"cd", X"16",X"06",X"cd",X"66",X"09",X"3f",X"d0",X"11", X"85",X"0e",X"cd",X"ce",X"0b",X"78",X"fe",X"05", X"3f",X"d8",X"01",X"85",X"0e",X"cd",X"1e",X"02", X"d8",X"22",X"8f",X"0e",X"21",X"85",X"0e",X"cd", X"16",X"06",X"b7",X"c9",X"21",X"00",X"00",X"0a", X"b7",X"c8",X"54",X"5d",X"29",X"29",X"19",X"29", X"d6",X"30",X"fe",X"0a",X"3f",X"d8",X"5f",X"16", X"00",X"19",X"03",X"c3",X"07",X"02",X"21",X"00", X"00",X"0a",X"b7",X"c8",X"29",X"29",X"29",X"29", X"cd",X"35",X"02",X"fe",X"10",X"3f",X"d8",X"85", X"6f",X"03",X"c3",X"21",X"02",X"d6",X"30",X"fe", X"0a",X"d8",X"d6",X"07",X"c9",X"cd",X"89",X"02", X"21",X"77",X"0e",X"46",X"cd",X"05",X"01",X"23", X"46",X"cd",X"05",X"01",X"c9",X"cd",X"3d",X"02", X"cd",X"60",X"02",X"c9",X"cd",X"a6",X"02",X"cd", X"40",X"02",X"23",X"46",X"cd",X"05",X"01",X"c9", X"06",X"20",X"cd",X"05",X"01",X"c9",X"2a",X"8d", X"0e",X"3a",X"90",X"0e",X"bc",X"c2",X"78",X"02", X"3a",X"8f",X"0e",X"bd",X"c2",X"78",X"02",X"37", X"23",X"22",X"8d",X"0e",X"c9",X"46",X"3e",X"0d", X"b8",X"c8",X"cd",X"05",X"01",X"23",X"c3",X"7d", X"02",X"21",X"77",X"0e",X"47",X"1f",X"1f",X"1f", X"1f",X"cd",X"9c",X"02",X"77",X"23",X"78",X"cd", X"9c",X"02",X"77",X"c9",X"e6",X"0f",X"c6",X"30", X"fe",X"3a",X"d8",X"c6",X"07",X"c9",X"21",X"77", X"0e",X"06",X"64",X"cd",X"b7",X"02",X"06",X"0a", X"cd",X"b7",X"02",X"c6",X"30",X"77",X"c9",X"36", X"2f",X"34",X"90",X"d2",X"b9",X"02",X"80",X"23", X"c9",X"64",X"75",X"6d",X"70",X"0b",X"03",X"65", X"78",X"65",X"63",X"24",X"01",X"65",X"6e",X"74", X"72",X"cf",X"04",X"66",X"69",X"6c",X"65",X"41", X"03",X"6c",X"69",X"73",X"74",X"29",X"06",X"64", X"65",X"6c",X"74",X"40",X"06",X"61",X"73",X"73", X"6d",X"b7",X"06",X"70",X"61",X"67",X"65",X"25", X"03",X"63",X"75",X"73",X"74",X"00",X"20",X"62", X"72",X"65",X"6b",X"2b",X"0d",X"70",X"72",X"6f", X"63",X"e6",X"0d",X"3a",X"81",X"0e",X"b7",X"ca", X"5d",X"04",X"c9",X"cd",X"03",X"03",X"cd",X"11", X"01",X"2a",X"8d",X"0e",X"7e",X"cd",X"4d",X"02", X"cd",X"66",X"02",X"d8",X"7d",X"e6",X"0f",X"c2", X"11",X"03",X"c3",X"0e",X"03",X"cd",X"03",X"03", X"3a",X"85",X"0e",X"b7",X"ca",X"5d",X"04",X"2a", X"8d",X"0e",X"eb",X"2a",X"8f",X"0e",X"06",X"00", X"1a",X"77",X"23",X"13",X"05",X"c2",X"38",X"03", X"c9",X"cd",X"11",X"01",X"3a",X"79",X"0e",X"b7", X"ca",X"bc",X"03",X"cd",X"1b",X"04",X"eb",X"c2", X"66",X"03",X"3a",X"81",X"0e",X"b7",X"ca",X"60", X"04",X"3a",X"80",X"0e",X"b7",X"c2",X"7b",X"03", X"21",X"6e",X"04",X"c3",X"63",X"04",X"3a",X"81", X"0e",X"b7",X"ca",X"8e",X"03",X"2a",X"8d",X"0e", X"7c",X"b5",X"ca",X"8e",X"03",X"21",X"73",X"04", X"c3",X"63",X"04",X"2a",X"7e",X"0e",X"eb",X"21", X"79",X"0e",X"d5",X"0e",X"05",X"7e",X"12",X"13", X"0d",X"23",X"c2",X"85",X"03",X"d1",X"21",X"27", X"0e",X"0e",X"0d",X"1a",X"46",X"77",X"78",X"12", X"13",X"23",X"0d",X"c2",X"93",X"03",X"3a",X"81", X"0e",X"b7",X"ca",X"c6",X"03",X"2a",X"8d",X"0e", X"22",X"2c",X"0e",X"22",X"2e",X"0e",X"7d",X"b4", X"ca",X"b5",X"03",X"36",X"01",X"af",X"32",X"30", X"0e",X"c3",X"c6",X"03",X"3a",X"ce",X"0e",X"fe", X"73",X"0e",X"06",X"ca",X"c8",X"03",X"0e",X"01", X"21",X"27",X"0e",X"79",X"32",X"80",X"0e",X"e5", X"11",X"05",X"00",X"19",X"7e",X"b7",X"c2",X"e6", X"03",X"23",X"86",X"23",X"c2",X"e6",X"03",X"33", X"33",X"23",X"23",X"c3",X"fb",X"03",X"e1",X"0e", X"05",X"46",X"cd",X"05",X"01",X"0d",X"23",X"c2", X"e9",X"03",X"cd",X"07",X"04",X"cd",X"07",X"04", X"cd",X"11",X"01",X"11",X"04",X"00",X"19",X"3a", X"80",X"0e",X"3d",X"c2",X"cc",X"03",X"c9",X"cd", X"60",X"02",X"23",X"7e",X"2b",X"e5",X"cd",X"3d", X"02",X"e1",X"7e",X"23",X"23",X"e5",X"cd",X"4d", X"02",X"e1",X"c9",X"af",X"32",X"80",X"0e",X"06", X"06",X"11",X"27",X"0e",X"21",X"79",X"0e",X"0e", X"05",X"cd",X"56",X"01",X"f5",X"d5",X"1a",X"b7", X"c2",X"51",X"04",X"13",X"1a",X"b7",X"c2",X"51", X"04",X"eb",X"11",X"fa",X"ff",X"19",X"22",X"7e", X"0e",X"7a",X"32",X"80",X"0e",X"e1",X"f1",X"11", X"08",X"00",X"19",X"eb",X"05",X"c8",X"c3",X"24", X"04",X"e1",X"f1",X"c2",X"47",X"04",X"11",X"fb", X"ff",X"19",X"7a",X"b7",X"c9",X"cd",X"11",X"01", X"21",X"69",X"04",X"cd",X"7d",X"02",X"c3",X"69", X"00",X"77",X"68",X"61",X"74",X"0d",X"66",X"75", X"6c",X"6c",X"0d",X"6e",X"6f",X"20",X"6e",X"6f", X"0d",X"49",X"4d",X"53",X"41",X"49",X"20",X"53", X"43",X"53",X"2d",X"31",X"20",X"4d",X"6f",X"6e", X"69",X"74",X"6f",X"72",X"2f",X"41",X"73",X"73", X"65",X"6d",X"62",X"6c",X"65",X"72",X"20",X"28", X"72",X"65",X"76",X"2e",X"20",X"32",X"20",X"30", X"36",X"20",X"6f",X"63",X"74",X"2e",X"20",X"31", X"39",X"37",X"36",X"29",X"0d",X"28",X"72",X"65", X"76",X"69",X"73",X"65",X"64",X"20",X"66",X"6f", X"72",X"20",X"6c",X"69",X"67",X"68",X"74",X"38", X"30",X"38",X"30",X"20",X"46",X"50",X"47",X"41", X"20",X"63",X"6f",X"72",X"65",X"29",X"0d",X"cd", X"03",X"03",X"cd",X"dc",X"04",X"da",X"5d",X"04", X"cd",X"11",X"01",X"c9",X"cd",X"11",X"01",X"cd", X"82",X"00",X"21",X"ca",X"0e",X"22",X"99",X"0e", X"cd",X"69",X"01",X"cd",X"66",X"09",X"da",X"dc", X"04",X"fe",X"2f",X"c8",X"cd",X"ce",X"0b",X"78", X"fe",X"03",X"3f",X"d8",X"01",X"81",X"0e",X"cd", X"1e",X"02",X"d8",X"7d",X"2a",X"8d",X"0e",X"77", X"cd",X"78",X"02",X"c3",X"e8",X"04",X"3a",X"27", X"0e",X"b7",X"ca",X"5d",X"04",X"0e",X"04",X"21", X"c9",X"0e",X"23",X"7e",X"fe",X"30",X"da",X"5d", X"04",X"fe",X"3a",X"d2",X"5d",X"04",X"0d",X"c2", X"1a",X"05",X"22",X"77",X"0e",X"11",X"33",X"0e", X"cd",X"fb",X"05",X"d2",X"53",X"05",X"23",X"cd", X"eb",X"05",X"21",X"33",X"0e",X"cd",X"f3",X"05", X"11",X"c9",X"0e",X"2a",X"2e",X"0e",X"0e",X"01", X"cd",X"d9",X"05",X"36",X"01",X"22",X"2e",X"0e", X"c3",X"69",X"00",X"cd",X"ab",X"05",X"0e",X"02", X"ca",X"5c",X"05",X"0d",X"46",X"2b",X"36",X"02", X"22",X"75",X"0e",X"3a",X"c9",X"0e",X"0d",X"ca", X"71",X"05",X"90",X"ca",X"94",X"05",X"da",X"84", X"05",X"2a",X"2e",X"0e",X"54",X"5d",X"cd",X"d4", X"05",X"22",X"2e",X"0e",X"0e",X"02",X"cd",X"e2", X"05",X"c3",X"94",X"05",X"2f",X"3c",X"54",X"5d", X"cd",X"d4",X"05",X"eb",X"cd",X"d9",X"05",X"36", X"01",X"22",X"2e",X"0e",X"2a",X"75",X"0e",X"36", X"0d",X"23",X"11",X"c9",X"0e",X"0e",X"01",X"cd", X"d9",X"05",X"c3",X"69",X"00",X"21",X"84",X"0e", X"22",X"77",X"0e",X"2a",X"2c",X"0e",X"7c",X"b5", X"ca",X"69",X"00",X"cd",X"cd",X"05",X"eb",X"2a", X"77",X"0e",X"eb",X"3e",X"04",X"cd",X"d4",X"05", X"cd",X"fb",X"05",X"d8",X"c8",X"7e",X"cd",X"d4", X"05",X"c3",X"b3",X"05",X"23",X"3e",X"01",X"be", X"c0",X"c3",X"69",X"00",X"85",X"6f",X"d0",X"24", X"c9",X"1a",X"13",X"b9",X"c8",X"77",X"23",X"c3", X"d9",X"05",X"1a",X"1b",X"b9",X"c8",X"77",X"2b", X"c3",X"e2",X"05",X"46",X"23",X"4e",X"23",X"56", X"23",X"5e",X"c9",X"73",X"2b",X"72",X"2b",X"71", X"2b",X"70",X"c9",X"06",X"01",X"0e",X"04",X"b7", X"1a",X"9e",X"ca",X"06",X"06",X"04",X"1b",X"2b", X"0d",X"c2",X"00",X"06",X"05",X"c9",X"0e",X"04", X"1a",X"d6",X"01",X"c3",X"01",X"06",X"cd",X"eb", X"05",X"af",X"b8",X"c8",X"bb",X"c4",X"f3",X"05", X"c0",X"5a",X"51",X"48",X"06",X"30",X"c3",X"1c", X"06",X"cd",X"11",X"01",X"cd",X"a5",X"05",X"23", X"cd",X"7d",X"02",X"cd",X"11",X"01",X"cd",X"cc", X"05",X"cd",X"eb",X"00",X"c2",X"2f",X"06",X"c9", X"cd",X"03",X"03",X"cd",X"a5",X"05",X"22",X"75", X"0e",X"21",X"88",X"0e",X"7e",X"b7",X"c2",X"54", X"06",X"21",X"84",X"0e",X"22",X"77",X"0e",X"eb", X"21",X"33",X"0e",X"cd",X"fb",X"05",X"2a",X"75", X"0e",X"da",X"a2",X"06",X"22",X"2e",X"0e",X"36", X"01",X"eb",X"2a",X"2c",X"0e",X"eb",X"06",X"0d", X"2b",X"7d",X"93",X"7c",X"9a",X"3e",X"0d",X"da", X"99",X"06",X"05",X"2b",X"be",X"c2",X"71",X"06", X"2b",X"7d",X"93",X"7c",X"9a",X"da",X"9a",X"06", X"be",X"23",X"23",X"ca",X"8f",X"06",X"23",X"cd", X"eb",X"05",X"21",X"33",X"0e",X"cd",X"f3",X"05", X"c9",X"b8",X"eb",X"c2",X"8e",X"06",X"32",X"30", X"0e",X"c9",X"cd",X"b3",X"05",X"cc",X"c5",X"05", X"eb",X"2a",X"75",X"0e",X"0e",X"01",X"cd",X"d9", X"05",X"22",X"2e",X"0e",X"36",X"01",X"c9",X"cd", X"03",X"03",X"3a",X"85",X"0e",X"b7",X"c2",X"c7", X"06",X"2a",X"8d",X"0e",X"22",X"8f",X"0e",X"3a", X"ce",X"0e",X"d6",X"65",X"32",X"91",X"0e",X"af", X"32",X"9b",X"0e",X"32",X"97",X"0e",X"cd",X"11", X"01",X"2a",X"8d",X"0e",X"22",X"95",X"0e",X"2a", X"2c",X"0e",X"22",X"75",X"0e",X"2a",X"75",X"0e", X"31",X"b5",X"0e",X"7e",X"fe",X"01",X"ca",X"5a", X"09",X"eb",X"13",X"21",X"b5",X"0e",X"3e",X"c5", X"cd",X"e3",X"00",X"0e",X"0d",X"cd",X"d9",X"05", X"71",X"eb",X"22",X"75",X"0e",X"3a",X"97",X"0e", X"b7",X"c2",X"12",X"07",X"cd",X"35",X"07",X"c3", X"e5",X"06",X"cd",X"ec",X"07",X"21",X"b5",X"0e", X"cd",X"1e",X"07",X"c3",X"e5",X"06",X"3a",X"91", X"0e",X"b7",X"c2",X"2b",X"07",X"3a",X"b5",X"0e", X"fe",X"20",X"c8",X"21",X"b5",X"0e",X"cd",X"7d", X"02",X"cd",X"11",X"01",X"c9",X"cd",X"69",X"01", X"32",X"97",X"0e",X"21",X"ca",X"0e",X"22",X"99", X"0e",X"7e",X"fe",X"20",X"ca",X"77",X"07",X"fe", X"2a",X"c8",X"cd",X"79",X"0b",X"da",X"38",X"0b", X"ca",X"20",X"0d",X"cd",X"8e",X"07",X"c2",X"38", X"0b",X"0e",X"05",X"21",X"81",X"0e",X"7e",X"12", X"13",X"23",X"0d",X"c2",X"5e",X"07",X"eb",X"22", X"93",X"0e",X"3a",X"96",X"0e",X"77",X"23",X"3a", X"95",X"0e",X"77",X"21",X"9b",X"0e",X"34",X"cd", X"69",X"01",X"cd",X"66",X"09",X"da",X"5f",X"0b", X"cd",X"ce",X"0b",X"fe",X"20",X"da",X"be",X"0a", X"c2",X"5f",X"0b",X"c3",X"be",X"0a",X"2a",X"99", X"0e",X"7e",X"fe",X"20",X"c8",X"fe",X"3a",X"c0", X"23",X"22",X"99",X"0e",X"c9",X"cd",X"66",X"09", X"1a",X"b7",X"ca",X"b9",X"07",X"fa",X"e9",X"07", X"e2",X"ce",X"07",X"fe",X"05",X"da",X"e1",X"07", X"c2",X"5a",X"09",X"0e",X"02",X"af",X"c3",X"4e", X"0b",X"cd",X"f0",X"0b",X"3a",X"b5",X"0e",X"fe", X"20",X"c0",X"22",X"95",X"0e",X"3a",X"ca",X"0e", X"fe",X"20",X"c8",X"c3",X"d9",X"07",X"cd",X"f0", X"0b",X"3a",X"ca",X"0e",X"fe",X"20",X"ca",X"f8", X"0c",X"eb",X"2a",X"93",X"0e",X"72",X"23",X"73", X"c9",X"cd",X"f0",X"0b",X"44",X"4d",X"c3",X"46", X"08",X"c3",X"4d",X"08",X"21",X"b7",X"0e",X"3a", X"96",X"0e",X"cd",X"8c",X"02",X"23",X"3a",X"95", X"0e",X"cd",X"8c",X"02",X"23",X"22",X"a1",X"0e", X"cd",X"69",X"01",X"21",X"ca",X"0e",X"22",X"99", X"0e",X"7e",X"fe",X"20",X"ca",X"77",X"07",X"fe", X"2a",X"c8",X"cd",X"79",X"0b",X"da",X"1b",X"0d", X"cd",X"8e",X"07",X"c2",X"1b",X"0d",X"c3",X"77", X"07",X"1a",X"b7",X"ca",X"65",X"08",X"fa",X"4a", X"08",X"e2",X"53",X"08",X"fe",X"05",X"da",X"3a", X"08",X"c2",X"5a",X"09",X"cd",X"3a",X"09",X"c3", X"b3",X"07",X"cd",X"ed",X"0b",X"44",X"4d",X"2a", X"8f",X"0e",X"09",X"22",X"8f",X"0e",X"af",X"c3", X"51",X"0b",X"cd",X"f9",X"08",X"af",X"0e",X"01", X"c3",X"4e",X"0b",X"cd",X"ed",X"0b",X"eb",X"21", X"b7",X"0e",X"7a",X"cd",X"8c",X"02",X"23",X"7b", X"cd",X"8c",X"02",X"23",X"c9",X"cd",X"ed",X"0b", X"3a",X"b5",X"0e",X"fe",X"20",X"c0",X"cd",X"56", X"08",X"2a",X"95",X"0e",X"eb",X"22",X"95",X"0e", X"7d",X"93",X"5f",X"7c",X"9a",X"57",X"2a",X"8f", X"0e",X"19",X"22",X"8f",X"0e",X"c9",X"cd",X"47", X"09",X"c9",X"cd",X"ed",X"0b",X"c4",X"da",X"0c", X"7d",X"b7",X"ca",X"ae",X"08",X"fe",X"02",X"c4", X"da",X"0c",X"c3",X"ae",X"08",X"cd",X"ed",X"0b", X"c4",X"da",X"0c",X"7d",X"0f",X"dc",X"da",X"0c", X"17",X"fe",X"08",X"d4",X"da",X"0c",X"07",X"17", X"17",X"47",X"1a",X"80",X"fe",X"76",X"cc",X"da", X"0c",X"c3",X"86",X"08",X"cd",X"ed",X"0b",X"c4", X"da",X"0c",X"7d",X"fe",X"08",X"d4",X"da",X"0c", X"1a",X"fe",X"40",X"ca",X"da",X"08",X"fe",X"c7", X"7d",X"ca",X"ae",X"08",X"fa",X"b1",X"08",X"c3", X"ae",X"08",X"29",X"29",X"29",X"85",X"12",X"cd", X"18",X"09",X"cd",X"f0",X"0b",X"c4",X"da",X"0c", X"7d",X"fe",X"08",X"d4",X"da",X"0c",X"c3",X"b1", X"08",X"fe",X"06",X"cc",X"06",X"09",X"cd",X"47", X"09",X"cd",X"ed",X"0b",X"3c",X"fe",X"02",X"d4", X"f3",X"0c",X"7d",X"c3",X"86",X"08",X"cd",X"ed", X"0b",X"c4",X"da",X"0c",X"7d",X"fe",X"08",X"d4", X"da",X"0c",X"29",X"29",X"29",X"1a",X"85",X"5f", X"2a",X"99",X"0e",X"7e",X"fe",X"2c",X"23",X"22", X"99",X"0e",X"c2",X"e3",X"0c",X"7b",X"c9",X"fe", X"01",X"c2",X"37",X"09",X"cd",X"06",X"09",X"e6", X"08",X"c4",X"da",X"0c",X"7b",X"e6",X"f7",X"cd", X"47",X"09",X"cd",X"ed",X"0b",X"7d",X"54",X"cd", X"47",X"09",X"7a",X"c3",X"86",X"08",X"c9",X"2a", X"8f",X"0e",X"77",X"23",X"22",X"8f",X"0e",X"2a", X"a1",X"0e",X"23",X"cd",X"8c",X"02",X"22",X"a1", X"0e",X"c9",X"3a",X"97",X"0e",X"b7",X"c2",X"69", X"00",X"3e",X"01",X"c3",X"d3",X"06",X"2a",X"99", X"0e",X"7e",X"fe",X"20",X"c0",X"23",X"22",X"99", X"0e",X"c3",X"69",X"09",X"21",X"82",X"0e",X"22", X"77",X"0e",X"06",X"02",X"cd",X"a9",X"0a",X"c9", X"6f",X"72",X"67",X"00",X"00",X"65",X"71",X"75", X"00",X"01",X"64",X"62",X"00",X"00",X"ff",X"64", X"73",X"00",X"00",X"03",X"64",X"77",X"00",X"00", X"05",X"65",X"6e",X"64",X"00",X"06",X"00",X"68", X"6c",X"74",X"76",X"72",X"6c",X"63",X"07",X"72", X"72",X"63",X"0f",X"72",X"61",X"6c",X"17",X"72", X"61",X"72",X"1f",X"72",X"65",X"74",X"c9",X"63", X"6d",X"61",X"2f",X"73",X"74",X"63",X"37",X"64", X"61",X"61",X"27",X"63",X"6d",X"63",X"3f",X"65", X"69",X"00",X"fb",X"64",X"69",X"00",X"f3",X"6e", X"6f",X"70",X"00",X"00",X"78",X"63",X"68",X"67", X"eb",X"78",X"74",X"68",X"6c",X"e3",X"73",X"70", X"68",X"6c",X"f9",X"70",X"63",X"68",X"6c",X"e9", X"00",X"73",X"74",X"61",X"78",X"02",X"6c",X"64", X"61",X"78",X"0a",X"00",X"70",X"75",X"73",X"68", X"c5",X"70",X"6f",X"70",X"00",X"c1",X"69",X"6e", X"78",X"00",X"03",X"64",X"63",X"78",X"00",X"0b", X"64",X"61",X"64",X"00",X"09",X"00",X"69",X"6e", X"72",X"04",X"64",X"63",X"72",X"05",X"6d",X"6f", X"76",X"40",X"61",X"64",X"64",X"80",X"61",X"64", X"63",X"88",X"73",X"75",X"62",X"90",X"73",X"62", X"62",X"98",X"61",X"6e",X"61",X"a0",X"78",X"72", X"61",X"a8",X"6f",X"72",X"61",X"b0",X"63",X"6d", X"70",X"b8",X"72",X"73",X"74",X"c7",X"00",X"61", X"64",X"69",X"c6",X"61",X"63",X"69",X"ce",X"73", X"75",X"69",X"d6",X"73",X"62",X"69",X"de",X"61", X"6e",X"69",X"e6",X"78",X"72",X"69",X"ee",X"6f", X"72",X"69",X"f6",X"63",X"70",X"69",X"fe",X"69", X"6e",X"00",X"db",X"6f",X"75",X"74",X"d3",X"6d", X"76",X"69",X"06",X"00",X"6a",X"6d",X"70",X"00", X"c3",X"63",X"61",X"6c",X"6c",X"cd",X"6c",X"78", X"69",X"00",X"01",X"6c",X"64",X"61",X"00",X"3a", X"73",X"74",X"61",X"00",X"32",X"73",X"68",X"6c", X"64",X"22",X"6c",X"68",X"6c",X"64",X"2a",X"00", X"6e",X"7a",X"00",X"7a",X"00",X"08",X"6e",X"63", X"10",X"63",X"00",X"18",X"70",X"6f",X"20",X"70", X"65",X"28",X"70",X"00",X"30",X"6d",X"00",X"38", X"00",X"2a",X"77",X"0e",X"1a",X"b7",X"ca",X"bb", X"0a",X"48",X"cd",X"56",X"01",X"1a",X"c8",X"13", X"c3",X"a9",X"0a",X"3c",X"13",X"c9",X"21",X"81", X"0e",X"22",X"77",X"0e",X"11",X"80",X"09",X"06", X"04",X"cd",X"a9",X"0a",X"ca",X"67",X"0b",X"05", X"cd",X"a9",X"0a",X"ca",X"da",X"0a",X"04",X"cd", X"a9",X"0a",X"21",X"86",X"08",X"0e",X"01",X"ca", X"3a",X"0b",X"cd",X"a9",X"0a",X"21",X"8a",X"08", X"ca",X"dd",X"0a",X"cd",X"a9",X"0a",X"21",X"9d", X"08",X"ca",X"dd",X"0a",X"05",X"cd",X"a9",X"0a", X"21",X"bc",X"08",X"ca",X"dd",X"0a",X"cd",X"a9", X"0a",X"21",X"f1",X"08",X"0e",X"02",X"ca",X"3a", X"0b",X"04",X"cd",X"a9",X"0a",X"ca",X"35",X"0b", X"cd",X"74",X"09",X"c2",X"5f",X"0b",X"c6",X"c0", X"57",X"06",X"03",X"3a",X"81",X"0e",X"4f",X"fe", X"72",X"7a",X"ca",X"da",X"0a",X"79",X"14",X"14", X"fe",X"6a",X"ca",X"34",X"0b",X"fe",X"63",X"c2", X"5f",X"0b",X"14",X"14",X"7a",X"21",X"27",X"09", X"0e",X"03",X"32",X"a0",X"0e",X"3e",X"81",X"80", X"5f",X"3e",X"0e",X"ce",X"00",X"57",X"1a",X"b7", X"c2",X"5f",X"0b",X"3a",X"97",X"0e",X"06",X"00", X"eb",X"2a",X"95",X"0e",X"09",X"22",X"95",X"0e", X"b7",X"c8",X"3a",X"a0",X"0e",X"eb",X"e9",X"21", X"06",X"0d",X"0e",X"03",X"c3",X"4b",X"0b",X"21", X"85",X"0e",X"7e",X"b7",X"c2",X"5f",X"0b",X"3a", X"97",X"0e",X"b7",X"ca",X"9d",X"07",X"c3",X"21", X"08",X"fe",X"61",X"d8",X"fe",X"7b",X"3f",X"d8", X"cd",X"ce",X"0b",X"21",X"81",X"0e",X"22",X"77", X"0e",X"05",X"c2",X"9d",X"0b",X"04",X"11",X"b9", X"0b",X"cd",X"a9",X"0a",X"c2",X"9d",X"0b",X"6f", X"26",X"00",X"c3",X"b3",X"0b",X"3a",X"9b",X"0e", X"47",X"11",X"1d",X"0f",X"b7",X"ca",X"b6",X"0b", X"3e",X"05",X"32",X"98",X"0e",X"cd",X"3f",X"01", X"4c",X"65",X"69",X"37",X"3f",X"c9",X"3c",X"b7", X"c9",X"61",X"07",X"62",X"00",X"63",X"01",X"64", X"02",X"65",X"03",X"68",X"04",X"6c",X"05",X"6d", X"06",X"70",X"06",X"73",X"06",X"00",X"06",X"00", X"12",X"04",X"78",X"fe",X"0b",X"d0",X"13",X"23", X"22",X"99",X"0e",X"7e",X"fe",X"30",X"d8",X"fe", X"3a",X"da",X"d0",X"0b",X"fe",X"61",X"d8",X"fe", X"7b",X"da",X"d0",X"0b",X"c9",X"cd",X"66",X"09", X"21",X"00",X"00",X"22",X"9d",X"0e",X"24",X"22", X"9e",X"0e",X"2a",X"99",X"0e",X"2b",X"cd",X"69", X"01",X"32",X"9c",X"0e",X"23",X"7e",X"fe",X"21", X"da",X"ac",X"0c",X"fe",X"2c",X"ca",X"ac",X"0c", X"fe",X"2b",X"ca",X"1d",X"0c",X"fe",X"2d",X"c2", X"2d",X"0c",X"32",X"9c",X"0e",X"3a",X"9f",X"0e", X"fe",X"02",X"ca",X"e3",X"0c",X"3e",X"02",X"32", X"9f",X"0e",X"c3",X"04",X"0c",X"4f",X"3a",X"9f", X"0e",X"b7",X"ca",X"e3",X"0c",X"79",X"fe",X"24", X"c2",X"45",X"0c",X"23",X"22",X"99",X"0e",X"2a", X"95",X"0e",X"c3",X"81",X"0c",X"fe",X"27",X"c2", X"71",X"0c",X"11",X"00",X"00",X"0e",X"03",X"23", X"22",X"99",X"0e",X"7e",X"fe",X"0d",X"ca",X"01", X"0d",X"fe",X"27",X"c2",X"68",X"0c",X"23",X"22", X"99",X"0e",X"7e",X"fe",X"27",X"c2",X"82",X"0c", X"0d",X"ca",X"01",X"0d",X"53",X"5f",X"c3",X"4f", X"0c",X"fe",X"30",X"da",X"01",X"0d",X"fe",X"3a", X"d2",X"a0",X"0c",X"cd",X"bc",X"0c",X"da",X"01", X"0d",X"eb",X"2a",X"9d",X"0e",X"af",X"32",X"9f", X"0e",X"3a",X"9c",X"0e",X"b7",X"c2",X"97",X"0c", X"19",X"22",X"9d",X"0e",X"c3",X"fa",X"0b",X"7d", X"93",X"6f",X"7c",X"9a",X"67",X"c3",X"91",X"0c", X"cd",X"79",X"0b",X"ca",X"81",X"0c",X"da",X"01", X"0d",X"c3",X"ee",X"0c",X"3a",X"9f",X"0e",X"b7", X"c2",X"e3",X"0c",X"2a",X"9d",X"0e",X"7c",X"11", X"a0",X"0e",X"b7",X"c9",X"cd",X"ce",X"0b",X"1b", X"1a",X"01",X"81",X"0e",X"fe",X"68",X"ca",X"d4", X"0c",X"fe",X"64",X"c2",X"d0",X"0c",X"af",X"12", X"cd",X"04",X"02",X"c9",X"af",X"12",X"cd",X"1e", X"02",X"c9",X"3e",X"72",X"21",X"00",X"00",X"32", X"b5",X"0e",X"c9",X"3e",X"73",X"32",X"b5",X"0e", X"21",X"00",X"00",X"c3",X"b6",X"0c",X"3e",X"75", X"c3",X"e5",X"0c",X"3e",X"76",X"c3",X"dc",X"0c", X"3e",X"6d",X"32",X"b5",X"0e",X"cd",X"2b",X"07", X"c9",X"3e",X"61",X"c3",X"e5",X"0c",X"3e",X"6f", X"32",X"b5",X"0e",X"3a",X"97",X"0e",X"b7",X"c8", X"0e",X"03",X"af",X"cd",X"47",X"09",X"0d",X"c2", X"12",X"0d",X"c9",X"3e",X"6c",X"c3",X"08",X"0d", X"3e",X"64",X"32",X"b5",X"0e",X"cd",X"1e",X"07", X"c3",X"77",X"07",X"3a",X"81",X"0e",X"b7",X"ca", X"6d",X"0d",X"16",X"08",X"21",X"0f",X"0e",X"7e", X"23",X"46",X"b0",X"ca",X"47",X"0d",X"23",X"23", X"15",X"c2",X"37",X"0d",X"c3",X"5d",X"04",X"2b", X"eb",X"2a",X"8d",X"0e",X"eb",X"7a",X"b7",X"c2", X"58",X"0d",X"7b",X"fe",X"0b",X"da",X"5d",X"04", X"72",X"23",X"73",X"23",X"1a",X"77",X"3e",X"cf", X"12",X"3e",X"c3",X"32",X"08",X"00",X"21",X"87", X"0d",X"22",X"09",X"00",X"c9",X"21",X"0f",X"0e", X"06",X"08",X"af",X"56",X"77",X"23",X"5e",X"77", X"23",X"46",X"23",X"7a",X"b3",X"ca",X"82",X"0d", X"78",X"12",X"05",X"c2",X"72",X"0d",X"c9",X"22", X"0b",X"0e",X"e1",X"2b",X"22",X"0d",X"0e",X"f5", X"e1",X"22",X"03",X"0e",X"21",X"00",X"00",X"39", X"31",X"0b",X"0e",X"e5",X"d5",X"c5",X"2f",X"31", X"b5",X"0e",X"2a",X"0d",X"0e",X"eb",X"21",X"0f", X"0e",X"06",X"08",X"7e",X"23",X"ba",X"c2",X"b6", X"0d",X"7e",X"bb",X"ca",X"bf",X"0d",X"23",X"23", X"05",X"ca",X"5d",X"04",X"c3",X"ab",X"0d",X"23", X"7e",X"12",X"af",X"2b",X"77",X"2b",X"77",X"cd", X"11",X"01",X"3a",X"0e",X"0e",X"cd",X"3d",X"02", X"3a",X"0d",X"0e",X"cd",X"3d",X"02",X"21",X"df", X"0d",X"cd",X"7d",X"02",X"c3",X"69",X"00",X"20", X"62",X"72",X"65",X"61",X"6b",X"0d",X"3a",X"81", X"0e",X"b7",X"ca",X"f3",X"0d",X"2a",X"8d",X"0e", X"22",X"0d",X"0e",X"31",X"03",X"0e",X"f1",X"c1", X"d1",X"e1",X"f9",X"2a",X"0d",X"0e",X"e5",X"2a", X"0b",X"0e",X"c9",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00", X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00" -- @end_rom ); -- i/o signals signal data_io_in : std_logic_vector(7 downto 0); signal data_mem_in : std_logic_vector(7 downto 0); -- Clock & reset signals signal clk_1hz : std_logic; signal counter_1hz : integer; signal reset : std_logic; begin -- Program memory (it's RAM really) rom_addr <= addr(11 downto 0); process(clk_50MHz) begin if (clk_50MHz'event and clk_50MHz='1') then data_mem_in <= rom(conv_integer(rom_addr)); if wr = '1' then rom(conv_integer(rom_addr)) <= data_out; end if; end if; end process; process(clk_50MHz) begin if (clk_50MHz'event and clk_50MHz='1') then if reset='1' then reg_h <= "00000000"; reg_l <= "00000000"; else if io_write='1' then if addr(7 downto 0)=X"40" then reg_l <= data_out; end if; if addr(7 downto 0)=X"f1" then -- FIXME reg_h <= data_out; end if; end if; end if; end if; end process; -- CPU control signals intr <= '0'; -- CPU instance cpu: light8080 port map( clk => clk_50MHz, reset => reset, vma => vma, rd => rd, wr => wr, io => io, addr_out => addr, data_in => data_in, data_out => data_out, intr => intr, inte => inte, inta => inta, halt => halt ); process(clk_50MHz) begin if clk_50MHz'event and clk_50MHz = '1' then if reset = '1' then io_q <= '0'; rd_q <= '0'; io_port <= X"00"; data_io_out <= X"00"; else io_q <= io; rd_q <= rd; io_port <= addr(7 downto 0); data_io_out <= data_out; end if; end if; end process; red_leds(0) <= halt; red_leds(1) <= inte; red_leds(2) <= vma; red_leds(3) <= rd; red_leds(4) <= wr; red_leds(9) <= tx_rdy; red_leds(8) <= rx_rdy; red_leds(7 downto 5) <= "000"; --##### Input ports ########################################################### -- mem vs. io input mux data_in <= data_io_in when io_q='1' else data_mem_in; -- io read enable (for async io ports; data read in cycle following io='1') io_read <= '1' when io_q='1' and rd_q='1' else '0'; -- io write enable (for sync io ports; dara written in cycle following io='1') io_write <= '1' when io='1' and wr='1' else '0'; -- read/write signals for rs232 modules read_rx <= '1' when io_read='1' and addr(7 downto 0)=X"21" else '0'; write_tx <= '1' when io_write='1' and addr(7 downto 0)=X"21" else '0'; -- synchronized input port mux (using registered port address) with io_port select data_io_in <= rs232_status when X"20", rs232_data_rx when X"21", switches(7 downto 0) when others; -- X"40" --############################################################################## -- terasIC Cyclone II STARTER KIT BOARD --############################################################################## --############################################################################## -- FLASH --############################################################################## -- Flash is unused flash_addr <= "000000000000" & switches; flash_we <= '1'; flash_oe <= '1'; flash_reset <= '1'; --green_leds <= flash_data; --############################################################################## -- RESET, CLOCK --############################################################################## -- Use button 3 as reset reset <= not buttons(3); -- Generate a 1-Hz clock for visual reference process(clk_50MHz) begin if clk_50MHz'event and clk_50MHz='1' then if buttons(3) = '1' then clk_1hz <= '0'; counter_1hz <= 0; else if buttons(2) = '0' then if counter_1hz = 25000000 then counter_1hz <= 0; clk_1hz <= not clk_1hz; else counter_1hz <= counter_1hz + 1; end if; end if; end if; end if; end process; --############################################################################## -- LEDS, SWITCHES --############################################################################## green_leds <= reg_l; --############################################################################## -- SERIAL --############################################################################## --txd <= rxd; -- loopback rs-232 serial_rx : rs232_rx port map( rxd => rxd, data_rx => rs232_data_rx, rx_rdy => rx_rdy, read_rx => read_rx, clk => clk_50MHz, reset => reset ); serial_tx : rs232_tx port map( clk => clk_50MHz, reset => reset, rdy => tx_rdy, load => write_tx, data_i => data_out, txd => txd ); rs232_status <= (not tx_rdy) & "000000" & (not rx_rdy); end demo;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-------------------------------------------------------------------------------------------- -- DSP Builder (Version 7.2) -- Quartus II development tool and MATLAB/Simulink Interface -- -- Legal Notice: © 2007 Altera Corporation. All rights reserved. Your use of Altera -- Corporation's design tools, logic functions and other software and tools, and its -- AMPP partner logic functions, and any output files any of the foregoing -- (including device programming or simulation files), and any associated -- documentation or information are expressly subject to the terms and conditions -- of the Altera Program License Subscription Agreement, Altera MegaCore Function -- License Agreement, or other applicable license agreement, including, without -- limitation, that your use is for the sole purpose of programming logic devices -- manufactured by Altera and sold by Altera or its authorized distributors. -- Please refer to the applicable agreement for further details. -------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; library altera; use altera.alt_dspbuilder_package.all; entity alt_dspbuilder_SInitDelay is generic ( lpm_width : positive :=8; lpm_delay : positive :=2; SequenceLength : positive :=1; SequenceValue : std_logic_vector :="1"; ResetValue : std_logic_vector :="00000001" ); port ( dataa : in std_logic_vector(lpm_width-1 downto 0); clock : in std_logic ; ena : in std_logic :='1'; aclr : in std_logic :='0'; user_aclr : in std_logic :='0'; sclr : in std_logic :='0'; result : out std_logic_vector(lpm_width-1 downto 0) :=(others=>'0') ); end alt_dspbuilder_SInitDelay; architecture SInitDelay_SYNTH of alt_dspbuilder_SInitDelay is type StdUArray is array (lpm_delay-1 downto 0) of std_logic_vector (lpm_width-1 downto 0); signal DelayLine : StdUArray; signal dataa_int : std_logic_vector(lpm_width-1 downto 0); signal seqenable : std_logic ; signal enadff : std_logic ; signal aclr_i : std_logic ; begin aclr_i <= aclr or user_aclr; u0: alt_dspbuilder_sAltrPropagate generic map(QTB=>DSPBuilderQTB, QTB_PRODUCT => DSPBuilderProduct, QTB_VERSION => DSPBuilderVersion , width=> lpm_width) port map (d => dataa, r => dataa_int); gnoseq: if ((SequenceLength=1) and (SequenceValue="1")) generate enadff <= ena; end generate gnoseq; gseq: if not ((SequenceLength=1) and (SequenceValue="1")) generate u:alt_dspbuilder_vecseq generic map (SequenceLength=>SequenceLength,SequenceValue=>SequenceValue) port map (clock=>clock, ena=>ena, aclr=>aclr_i, sclr=>sclr, yout=> seqenable); enadff <= seqenable and ena; end generate gseq; gen1:if lpm_delay=1 generate process(clock, aclr_i) begin if aclr_i='1' then result <= ResetValue; elsif clock'event and clock='1' then if (sclr ='1') then result <= ResetValue; elsif enadff ='1' then result <= dataa_int; end if; end if; end process; end generate; gen2:if lpm_delay>1 generate process(clock, aclr_i) begin if aclr_i='1' then DelayLine <= (others => ResetValue); elsif clock'event and clock='1' then if (sclr='1') then DelayLine <= (others => ResetValue); elsif (enadff='1') then DelayLine(0) <= dataa_int; for i in 1 to lpm_delay-1 loop DelayLine(i) <= DelayLine(i-1); end loop; end if; end if; end process; result <= DelayLine(lpm_delay-1); end generate; end SInitDelay_SYNTH;
-- NEED RESULT: ARCH00497: Aggregates in constant declarations (locally static) passed -- NEED RESULT: ARCH00497: Aggregates in variable declarations (locally static) passed ------------------------------------------------------------------------------- -- -- Copyright (c) 1989 by Intermetrics, Inc. -- All rights reserved. -- ------------------------------------------------------------------------------- -- -- TEST NAME: -- -- CT00497 -- -- AUTHOR: -- -- A. Wilmot -- -- TEST OBJECTIVES: -- -- 7.3.2.2 (7) -- 7.3.2.2 (11) -- -- DESIGN UNIT ORDERING: -- -- ENT00497(ARCH00497) -- ENT00497_Test_Bench(ARCH00497_Test_Bench) -- -- REVISION HISTORY: -- -- 10-AUG-1987 - initial revision -- -- NOTES: -- -- self-checking -- automatically generated -- use WORK.STANDARD_TYPES.all ; entity ENT00497 is generic ( constant g_a11 : boolean := false ; constant g_a12 : boolean := true ; constant g_a21 : integer := 1 ; constant g_a22 : integer := 5 ; constant g_b11 : integer := 0 ; constant g_b12 : integer := 0 ; constant g_b21 : integer := -5 ; constant g_b22 : integer := -3 ; constant g_c1 : integer := 0 ; constant g_c2 : integer := 4 ; constant g_d1 : integer := 3 ; constant g_d2 : integer := 5 ; constant g_r1 : integer := 1 ) ; constant r1 : integer := 1 ; constant a11 : boolean := false ; constant a12 : boolean := true ; constant a21 : integer := 1 ; constant a22 : integer := 5 ; constant b11 : integer := 0 ; constant b12 : integer := 0 ; constant b21 : integer := -5 ; constant b22 : integer := -3 ; constant c1 : integer := 0 ; constant c2 : integer := 4 ; constant d1 : integer := 3 ; constant d2 : integer := 5 ; -- type rec_arr is array ( integer range <> ) of boolean ; type rec_1 is record f1 : integer range - r1 to r1 ; -- f2 : rec_arr (-r1 to r1) ; f3, f4 : integer ; end record ; -- constant c_rec_arr : rec_arr (-r1 to r1) := -- (true, false, false) ; -- constant c_rec_1_1 : rec_1 := (1, (true, false, false), 1, 0) ; -- constant c_rec_1_2 : rec_1 := (0, (true, false, false), 0, 1) ; constant c_rec_1_1 : rec_1 := (1, 1, 0) ; constant c_rec_1_2 : rec_1 := (0, 0, 1) ; -- type arr_1 is array ( boolean range <> , integer range <> ) of rec_1 ; type time_matrix is array ( integer range <> , integer range <> ) of time ; -- -- subtype arange1 is boolean range a11 to a12 ; subtype arange2 is integer range a21 to a22 ; subtype brange1 is integer range b11 to b12 ; subtype brange2 is integer range b21 to b22 ; subtype crange is integer range c1 to c2 ; subtype drange is integer range d1 to d2 ; -- subtype st_arr_1 is arr_1 ( arange1 , arange2 ) ; subtype st_time_matrix is time_matrix ( brange1 , brange2 ) ; subtype st_bit_vector is bit_vector ( crange ) ; subtype st_string is string ( drange ) ; -- -- end ENT00497 ; -- architecture ARCH00497 of ENT00497 is begin B1 : block -- begin process variable v_arr_1 : st_arr_1 := ( ( c_rec_1_1, others => c_rec_1_2 ), others => (others => c_rec_1_1) ) ; variable v_time_matrix : st_time_matrix := ( st_time_matrix'right(1) => ( st_time_matrix'right(2) => 10 ns, others => 5 fs), others => (brange2'left => 10 ps, others => 15ms) ) ; variable v_bit_vector : st_bit_vector := ( 0 => '1', 2 => '1', others => '0' ) ; variable v_string : st_string := ( 3 => 'a', 4 => 'b', others => '0' ) ; variable v_rec_1 : rec_1 := -- ( f2 => (r1 => true, others => false), f3 => 1, others => 0) ; ( f3 => 1, others => 0) ; constant c_arr_1 : st_arr_1 := ( ( c_rec_1_1, others => c_rec_1_2 ), others => (others => c_rec_1_1) ) ; constant c_time_matrix : st_time_matrix := ( st_time_matrix'right(1) => ( st_time_matrix'right(2) => 10 ns, others => 5 fs), others => (brange2'left => 10 ps, others => 15ms) ) ; constant c_bit_vector : st_bit_vector := ( 0 => '1', 2 => '1', others => '0' ) ; constant c_string : st_string := ( 3 => 'a', 4 => 'b', others => '0' ) ; constant c_rec_1 : rec_1 := -- ( f2 => (r1 => true, others => false), f3 => 1, others => 0) ; ( f3 => 1, others => 0) ; variable bool : boolean := true; -- begin bool := bool and c_arr_1(false, 1) = c_rec_1_1 ; for i in 2 to 5 loop bool := bool and c_arr_1(false, i) = c_rec_1_2 ; end loop ; for i in 1 to 5 loop bool := bool and c_arr_1(true, i) = c_rec_1_1 ; end loop ; -- bool := bool and c_time_matrix(0, -3) = 10 ns ; for i in integer'(-5) to -4 loop bool := bool and c_time_matrix(0, i) = 5 fs ; end loop ; -- bool := bool and c_bit_vector = B"10100" ; -- bool := bool and c_string = "ab0" ; -- bool := bool and c_rec_1.f1 = 0 and c_rec_1.f4 = 0 and c_rec_1.f3 = 1 ; -- bool := bool and c_rec_1.f2(1) = true -- and c_rec_1.f2(0) = false and -- c_rec_1.f2(-1) = false ; -- -- test_report ( "ARCH00497" , "Aggregates in constant declarations" & " (locally static)" , bool ) ; -- bool := true; bool := bool and v_arr_1(false, 1) = c_rec_1_1 ; for i in 2 to 5 loop bool := bool and v_arr_1(false, i) = c_rec_1_2 ; end loop ; for i in 1 to 5 loop bool := bool and v_arr_1(true, i) = c_rec_1_1 ; end loop ; -- bool := bool and v_time_matrix(0, -3) = 10 ns ; for i in integer'(-5) to -4 loop bool := bool and v_time_matrix(0, i) = 5 fs ; end loop ; -- bool := bool and v_bit_vector = B"10100" ; -- bool := bool and v_string = "ab0" ; -- bool := bool and v_rec_1.f1 = 0 and v_rec_1.f4 = 0 and v_rec_1.f3 = 1 ; -- bool := bool and v_rec_1.f2(1) = true -- and v_rec_1.f2(0) = false and -- v_rec_1.f2(-1) = false ; -- -- test_report ( "ARCH00497" , "Aggregates in variable declarations" & " (locally static)" , bool ) ; wait ; end process ; end block B1 ; end ARCH00497 ; -- entity ENT00497_Test_Bench is end ENT00497_Test_Bench ; -- architecture ARCH00497_Test_Bench of ENT00497_Test_Bench is begin L1: block component UUT end component ; -- for CIS1 : UUT use entity WORK.ENT00497 ( ARCH00497 ) ; begin CIS1 : UUT ; end block L1 ; end ARCH00497_Test_Bench ;
--------------------------------------------------------------------------------------------------- -- -- Title : contr_config -- Design : ring bus -- Author : Zhao Ming -- Company : a4a881d4 -- --------------------------------------------------------------------------------------------------- -- -- File : contr_config.vhd -- Generated : 2013/9/10 -- From : -- By : -- --------------------------------------------------------------------------------------------------- -- -- Description : Control reg config -- -- Rev: 3.1 -- --------------------------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.all; package contr_config is constant reg_Control_RESET : std_logic_vector( 3 downto 0 ) := "0000"; constant reg_Control_START : std_logic_vector( 3 downto 0 ) := "1111"; constant reg_Control_ADDR : std_logic_vector( 3 downto 0 ) := "0001"; constant reg_Control_DATA : std_logic_vector( 3 downto 0 ) := "0010"; constant reg_Control_BADDR : std_logic_vector( 3 downto 0 ) := "0100"; constant reg_Control_BID : std_logic_vector( 3 downto 0 ) := "0101"; constant reg_Control_Command : std_logic_vector( 3 downto 0 ) := "1000"; constant reg_Control_Tag : std_logic_vector( 3 downto 0 ) := "1001"; constant reg_Control_rdTag : std_logic_vector( 3 downto 0 ) := "1010"; -- constant reg_Control_TagState : std_logic_vector( 3 downto 0 ) := "1111"; constant reg_Control_Busy : std_logic_vector( 3 downto 0 ) := "0000"; constant reg_Control_TagData : std_logic_vector( 3 downto 0 ) := "0001"; component CSlave generic( Bwidth : natural := 16 ); port( -- system clk : in STD_LOGIC; rst : in STD_LOGIC; -- send to bus tx: out std_logic_vector( Bwidth-1 downto 0 ); Req : out std_logic; tx_sop : in std_logic; en : in std_logic; -- read from bus rx_sop : in std_logic; rx: in std_logic_vector( Bwidth-1 downto 0 ); -- Local Bus addr : out std_logic_vector( Bwidth-1 downto 0 ); Din : in STD_LOGIC_VECTOR( Bwidth-1 downto 0 ); Dout : out STD_LOGIC_VECTOR( Bwidth-1 downto 0 ) := (others => '0'); wr : out std_logic; rd : out std_logic -- ); end component; component CMaster generic( Bwidth : natural := 16; POS : natural := 0; MyBusID : natural := 0 ); port( -- system clk : in STD_LOGIC; rst : in STD_LOGIC; -- send to bus tx: out std_logic_vector(Bwidth-1 downto 0); Req : out std_logic; tx_sop : in std_logic; en : in std_logic; -- read from bus rx_sop : in std_logic; rx: in std_logic_vector(Bwidth-1 downto 0); -- Local Bus CS : in std_logic; addr : in std_logic_vector(3 downto 0); Din : in STD_LOGIC_VECTOR(7 downto 0); Dout : out STD_LOGIC_VECTOR(7 downto 0); cpuClk : in std_logic; wr : in std_logic; rd : in std_logic -- ); end component; end contr_config;
--------------------------------------------------------------------------------------------------- -- -- Title : contr_config -- Design : ring bus -- Author : Zhao Ming -- Company : a4a881d4 -- --------------------------------------------------------------------------------------------------- -- -- File : contr_config.vhd -- Generated : 2013/9/10 -- From : -- By : -- --------------------------------------------------------------------------------------------------- -- -- Description : Control reg config -- -- Rev: 3.1 -- --------------------------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.all; package contr_config is constant reg_Control_RESET : std_logic_vector( 3 downto 0 ) := "0000"; constant reg_Control_START : std_logic_vector( 3 downto 0 ) := "1111"; constant reg_Control_ADDR : std_logic_vector( 3 downto 0 ) := "0001"; constant reg_Control_DATA : std_logic_vector( 3 downto 0 ) := "0010"; constant reg_Control_BADDR : std_logic_vector( 3 downto 0 ) := "0100"; constant reg_Control_BID : std_logic_vector( 3 downto 0 ) := "0101"; constant reg_Control_Command : std_logic_vector( 3 downto 0 ) := "1000"; constant reg_Control_Tag : std_logic_vector( 3 downto 0 ) := "1001"; constant reg_Control_rdTag : std_logic_vector( 3 downto 0 ) := "1010"; -- constant reg_Control_TagState : std_logic_vector( 3 downto 0 ) := "1111"; constant reg_Control_Busy : std_logic_vector( 3 downto 0 ) := "0000"; constant reg_Control_TagData : std_logic_vector( 3 downto 0 ) := "0001"; component CSlave generic( Bwidth : natural := 16 ); port( -- system clk : in STD_LOGIC; rst : in STD_LOGIC; -- send to bus tx: out std_logic_vector( Bwidth-1 downto 0 ); Req : out std_logic; tx_sop : in std_logic; en : in std_logic; -- read from bus rx_sop : in std_logic; rx: in std_logic_vector( Bwidth-1 downto 0 ); -- Local Bus addr : out std_logic_vector( Bwidth-1 downto 0 ); Din : in STD_LOGIC_VECTOR( Bwidth-1 downto 0 ); Dout : out STD_LOGIC_VECTOR( Bwidth-1 downto 0 ) := (others => '0'); wr : out std_logic; rd : out std_logic -- ); end component; component CMaster generic( Bwidth : natural := 16; POS : natural := 0; MyBusID : natural := 0 ); port( -- system clk : in STD_LOGIC; rst : in STD_LOGIC; -- send to bus tx: out std_logic_vector(Bwidth-1 downto 0); Req : out std_logic; tx_sop : in std_logic; en : in std_logic; -- read from bus rx_sop : in std_logic; rx: in std_logic_vector(Bwidth-1 downto 0); -- Local Bus CS : in std_logic; addr : in std_logic_vector(3 downto 0); Din : in STD_LOGIC_VECTOR(7 downto 0); Dout : out STD_LOGIC_VECTOR(7 downto 0); cpuClk : in std_logic; wr : in std_logic; rd : in std_logic -- ); end component; end contr_config;
-- -- File Name: ResizePkg.vhd -- Design Unit Name: ResizePkg -- Revision: STANDARD VERSION -- -- Maintainer: Jim Lewis email: jim@SynthWorks.com -- Contributor(s): -- Jim Lewis email: jim@SynthWorks.com -- -- Package Defines -- Resizing for transaction records -- -- Developed for: -- SynthWorks Design Inc. -- VHDL Training Classes -- 11898 SW 128th Ave. Tigard, Or 97223 -- http://www.SynthWorks.com -- -- Revision History: -- Date Version Description -- 06/2021 2021.06 Refactored from ResolutionPkg -- -- -- This file is part of OSVVM. -- -- Copyright (c) 2005 - 2021 by SynthWorks Design Inc. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- https://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- library ieee ; use ieee.std_logic_1164.all ; use ieee.numeric_std.all ; use work.AlertLogPkg.all ; use work.ResolutionPkg.all ; package ResizePkg is -- -- ToTransaction and FromTransaction -- Convert from Common types to their corresponding _max_c type -- function Extend(A: std_logic_vector; Size : natural) return std_logic_vector ; function Reduce(A: std_logic_vector; Size : natural) return std_logic_vector ; impure function SafeResize(A : std_logic_vector; Size : natural) return std_logic_vector ; impure function SafeResize(A : std_logic_vector; Size : natural) return std_logic_vector_max_c ; impure function SafeResize(A : std_logic_vector_max_c; Size : natural) return std_logic_vector ; function ToTransaction(A : std_logic_vector) return std_logic_vector_max_c ; impure function ToTransaction(A : std_logic_vector ; Size : natural) return std_logic_vector_max_c ; function ToTransaction(A : integer; Size : natural) return std_logic_vector_max_c ; function FromTransaction (A: std_logic_vector_max_c) return std_logic_vector ; impure function FromTransaction (A: std_logic_vector_max_c ; Size : natural) return std_logic_vector ; function FromTransaction (A: std_logic_vector_max_c) return integer ; -- -- ToTransaction and FromTransaction for _max provided to support a -- common methodology, conversions are not needed function ToTransaction(A : std_logic_vector) return std_logic_vector_max ; impure function ToTransaction(A : std_logic_vector ; Size : natural) return std_logic_vector_max ; function ToTransaction(A : integer; Size : natural) return std_logic_vector_max ; function FromTransaction (A: std_logic_vector_max) return std_logic_vector ; impure function FromTransaction (A: std_logic_vector_max ; Size : natural) return std_logic_vector ; function FromTransaction (A: std_logic_vector_max) return integer ; end package ResizePkg ; package body ResizePkg is -- -- ToTransaction and FromTransaction -- Convert from Common types to their corresponding _max_c type -- function Extend(A: std_logic_vector; Size : natural) return std_logic_vector is variable extA : std_logic_vector(Size downto 1) := (others => '0') ; begin extA(A'length downto 1) := A ; return extA ; end function Extend ; function Reduce(A: std_logic_vector; Size : natural) return std_logic_vector is alias aA : std_logic_vector(A'length-1 downto 0) is A ; begin return aA(Size-1 downto 0) ; end function Reduce ; -- SafeResize - handles std_logic_vector as unsigned impure function LocalSafeResize(A : std_logic_vector; Size : natural) return std_logic_vector is variable Result : std_logic_vector(Size-1 downto 0) := (others => '0') ; alias aA : std_logic_vector(A'length-1 downto 0) is A ; begin if A'length <= Size then -- Extend A Result(A'length-1 downto 0) := aA ; else -- Reduce A and Error if any extra bits of A are a '1' AlertIf((OR aA(A'length-1 downto Size) = '1'), "ToTransaction/FromTransaction, threw away a 1") ; Result := aA(Size-1 downto 0) ; end if ; return Result ; end function LocalSafeResize ; impure function SafeResize(A : std_logic_vector; Size : natural) return std_logic_vector is begin return LocalSafeResize(A, Size) ; end function SafeResize ; impure function SafeResize(A : std_logic_vector; Size : natural) return std_logic_vector_max_c is begin return std_logic_vector_max_c(LocalSafeResize(A, Size)) ; end function SafeResize ; impure function SafeResize(A : std_logic_vector_max_c; Size : natural) return std_logic_vector is begin return LocalSafeResize(std_logic_vector(A), Size) ; end function SafeResize ; function ToTransaction(A : std_logic_vector) return std_logic_vector_max_c is begin return std_logic_vector_max_c(A) ; end function ToTransaction ; impure function ToTransaction(A : std_logic_vector ; Size : natural) return std_logic_vector_max_c is begin return std_logic_vector_max_c(LocalSafeResize(A, Size)) ; end function ToTransaction ; function ToTransaction(A : integer; Size : natural) return std_logic_vector_max_c is begin return std_logic_vector_max_c(to_signed(A, Size)) ; end function ToTransaction ; function FromTransaction (A: std_logic_vector_max_c) return std_logic_vector is begin return std_logic_vector(A) ; end function FromTransaction ; impure function FromTransaction (A: std_logic_vector_max_c ; Size : natural) return std_logic_vector is begin return LocalSafeResize(std_logic_vector(A), Size) ; end function FromTransaction ; function FromTransaction (A: std_logic_vector_max_c) return integer is begin return to_integer(signed(A)) ; end function FromTransaction ; ---------------------- -- Support for _max provided to support a common methodology, -- conversions are not needed function ToTransaction(A : std_logic_vector) return std_logic_vector_max is begin return A ; end function ToTransaction ; impure function ToTransaction(A : std_logic_vector ; Size : natural) return std_logic_vector_max is begin return LocalSafeResize(A, Size) ; end function ToTransaction ; function ToTransaction(A : integer; Size : natural) return std_logic_vector_max is begin return std_logic_vector_max(to_signed(A, Size)) ; end function ToTransaction ; function FromTransaction (A: std_logic_vector_max) return std_logic_vector is begin return A ; end function FromTransaction ; impure function FromTransaction (A: std_logic_vector_max ; Size : natural) return std_logic_vector is begin return LocalSafeResize(A, Size) ; end function FromTransaction ; function FromTransaction (A: std_logic_vector_max) return integer is begin return to_integer(signed(A)) ; end function FromTransaction ; end package body ResizePkg ;
-------------------------------------------------------------------------------- -- Author: Parham Alvani (parham.alvani@gmail.com) -- -- Create Date: 04-03-2016 -- Module Name: p4-2.vhd -------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; entity sixteen_bit_comparator is port (a, b : in std_logic_vector(15 downto 0); l, g, e : in std_logic; eq, gt, lt : out std_logic); end entity sixteen_bit_comparator; architecture structural of sixteen_bit_comparator is signal a0_b0_eq, a0_b0_gt, a0_b0_lt : std_logic; signal a1_b1_eq, a1_b1_gt, a1_b1_lt : std_logic; signal a2_b2_eq, a2_b2_gt, a2_b2_lt : std_logic; signal a3_b3_eq, a3_b3_gt, a3_b3_lt : std_logic; entity four_bit_comparator is port (a, b : in std_logic_vector(3 downto 0); l, g, e : in std_logic; eq, gt, lt : out std_logic); end entity four_bit_comparator; for all:four_bit_comparator use entity work.four_bit_comparator; begin c0: four_bit_comparator port map (a(3 downto 0), b(3 downto 0), open, open, open, a0_b0_eq, a0_b0_gt, a0_b0_lt); c1: four_bit_comparator port map (a(7 downto 4), b(7 downto 4), open, open, open, a1_b1_eq, a1_b1_gt, a1_b1_lt); c2: four_bit_comparator port map (a(11 downto 8), b(11 downto 8), open, open, open, a2_b2_eq, a2_b2_gt, a2_b2_lt); c3: four_bit_comparator port map (a(15 downto 12), b(15 downto 12), open, open, open, a3_b3_eq, a3_b3_gt, a3_b3_lt); eq <= a3_b3_eq and a2_b2_eq and a1_b1_eq and a0_b0_eq; gt <= a3_b3_gt or (a2_b2_gt and a3_b3_eq) or (a1_b1_gt and a2_b2_eq and a3_b3_eq) or (a0_b0_gt and a1_b1_eq and a2_b2_eq and a3_b3_eq); lt <= a3_b3_lt or (a2_b2_lt and a3_b3_eq) or (a1_b1_lt and a2_b2_eq and a3_b3_eq) or (a0_b0_lt and a1_b1_eq and a2_b2_eq and a3_b3_eq); end architecture structural;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2014, Aeroflex Gaisler -- Copyright (C) 2015 - 2016, Cobham Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ----------------------------------------------------------------------------- -- Entity: inpad_ddr, inpad_ddrv -- File: inpad_ddr.vhd -- Author: Jan Andersson - Aeroflex Gaisler -- Description: Wrapper that instantiates an input pad connected to a DDR_IREG. -- The generic tech wrappers are not used for nextreme since this -- technology is not wrapped by ddr_ireg. ------------------------------------------------------------------------------ library techmap; library ieee; use ieee.std_logic_1164.all; use techmap.gencomp.all; use techmap.allddr.all; use techmap.allpads.all; entity inpad_ddr is generic ( tech : integer := 0; level : integer := 0; voltage : integer := x33v; filter : integer := 0; strength : integer := 0 ); port ( pad : in std_ulogic; o1, o2 : out std_ulogic; c1, c2 : in std_ulogic; ce : in std_ulogic; r : in std_ulogic; s : in std_ulogic ); end; architecture rtl of inpad_ddr is signal d : std_ulogic; signal gnd : std_ulogic; begin gnd <= '0'; def: if (tech /= easic90) and (tech /= easic45) generate p : inpad generic map (tech, level, voltage, filter, strength) port map (pad, d); ddrreg : ddr_ireg generic map (tech) port map (o1, o2, c1, c2, ce, d, r, s, gnd, gnd); end generate def; nex : if (tech = easic90) generate p : nextreme_inpad generic map (level, voltage) port map(pad, d); ddrreg : nextreme_iddr_reg port map (ck => c1, d => d, qh => o1, ql => o2, rstb => r); end generate; n2x : if (tech = easic45) generate p : n2x_inpad_ddr generic map (level, voltage) port map (pad, o1, o2, c1, c2, ce, r, s); d <= '0'; end generate; end; library techmap; library ieee; use ieee.std_logic_1164.all; use techmap.gencomp.all; use techmap.allpads.all; entity inpad_ddrv is generic ( tech : integer := 0; level : integer := 0; voltage : integer := 0; filter : integer := 0; strength : integer := 0; width : integer := 1 ); port ( pad : in std_logic_vector(width-1 downto 0); o1, o2 : out std_logic_vector(width-1 downto 0); c1, c2 : in std_ulogic; ce : in std_ulogic; r : in std_ulogic; s : in std_ulogic ); end; architecture rtl of inpad_ddrv is begin n2x : if (tech = easic45) generate p : n2x_inpad_ddrv generic map (level, voltage, width) port map (pad, o1, o2, c1, c2, ce, r, s); end generate; base : if (tech /= easic45) generate v : for i in width-1 downto 0 generate x0 : inpad_ddr generic map (tech, level, voltage, filter, strength) port map (pad(i), o1(i), o2(i), c1, c2, ce, r, s); end generate; end generate; end;
library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.NUMERIC_STD.all; use work.gn4124_core_pkg.all; package common_pkg is component generic_async_fifo is generic ( g_data_width : natural; g_size : natural; g_show_ahead : boolean := false; -- Read-side flag selection g_with_rd_empty : boolean := true; -- with empty flag g_with_rd_full : boolean := false; -- with full flag g_with_rd_almost_empty : boolean := false; g_with_rd_almost_full : boolean := false; g_with_rd_count : boolean := false; -- with words counter g_with_wr_empty : boolean := false; g_with_wr_full : boolean := true; g_with_wr_almost_empty : boolean := false; g_with_wr_almost_full : boolean := false; g_with_wr_count : boolean := false; g_almost_empty_threshold : integer; -- threshold for almost empty flag g_almost_full_threshold : integer -- threshold for almost full flag ); port ( rst_n_i : in std_logic := '1'; -- write port clk_wr_i : in std_logic; d_i : in std_logic_vector(g_data_width-1 downto 0); we_i : in std_logic; wr_empty_o : out std_logic; wr_full_o : out std_logic; wr_almost_empty_o : out std_logic; wr_almost_full_o : out std_logic; wr_count_o : out std_logic_vector(log2_ceil(g_size)-1 downto 0); -- read port clk_rd_i : in std_logic; q_o : out std_logic_vector(g_data_width-1 downto 0); rd_i : in std_logic; rd_empty_o : out std_logic; rd_full_o : out std_logic; rd_almost_empty_o : out std_logic; rd_almost_full_o : out std_logic; rd_count_o : out std_logic_vector(log2_ceil(g_size)-1 downto 0) ); end component generic_async_fifo; component wb_spi generic ( g_CLK_DIVIDER : positive := 20 ); port ( -- Sys Connect wb_clk_i : in std_logic; rst_n_i : in std_logic; -- Wishbone slave interface wb_adr_i : in std_logic_vector(31 downto 0) := (others => '0'); wb_dat_i : in std_logic_vector(31 downto 0) := (others => '0'); wb_dat_o : out std_logic_vector(31 downto 0); wb_cyc_i : in std_logic := '0'; wb_stb_i : in std_logic := '0'; wb_we_i : in std_logic := '0'; wb_ack_o : out std_logic; -- SPI out scl_o : out std_logic; sda_o : out std_logic; sdi_i : in std_logic; latch_o : out std_logic ); end component; end common_pkg; package body common_pkg is end common_pkg;
library ieee; use ieee.numeric_std.all; use ieee.std_logic_1164.all; entity ex4_rnd is port( clock: in std_logic; input: in std_logic_vector(5 downto 0); output: out std_logic_vector(8 downto 0) ); end ex4_rnd; architecture behaviour of ex4_rnd is constant s1: std_logic_vector(3 downto 0) := "1101"; constant s3: std_logic_vector(3 downto 0) := "0010"; constant s2: std_logic_vector(3 downto 0) := "1011"; constant s5: std_logic_vector(3 downto 0) := "1110"; constant s7: std_logic_vector(3 downto 0) := "1111"; constant s11: std_logic_vector(3 downto 0) := "0001"; constant s12: std_logic_vector(3 downto 0) := "0110"; constant s8: std_logic_vector(3 downto 0) := "0000"; constant s4: std_logic_vector(3 downto 0) := "1010"; constant s13: std_logic_vector(3 downto 0) := "1000"; constant s14: std_logic_vector(3 downto 0) := "0100"; constant s6: std_logic_vector(3 downto 0) := "1001"; constant s9: std_logic_vector(3 downto 0) := "1100"; constant s10: std_logic_vector(3 downto 0) := "0011"; signal current_state, next_state: std_logic_vector(3 downto 0); begin process(clock) begin if rising_edge(clock) then current_state <= next_state; end if; end process; process(input, current_state) begin next_state <= "----"; output <= "---------"; case current_state is when s1 => if std_match(input, "1-----") then next_state <= s3; output <= "110000000"; end if; when s3 => if std_match(input, "1-----") then next_state <= s2; output <= "000000000"; end if; when s2 => if std_match(input, "1-----") then next_state <= s5; output <= "001000000"; end if; when s5 => if std_match(input, "1-----") then next_state <= s7; output <= "000000000"; end if; when s7 => if std_match(input, "10----") then next_state <= s7; output <= "000000000"; elsif std_match(input, "11----") then next_state <= s11; output <= "100110000"; end if; when s11 => if std_match(input, "1-----") then next_state <= s12; output <= "100100000"; end if; when s12 => if std_match(input, "1-1---") then next_state <= s8; output <= "000001100"; elsif std_match(input, "1-0---") then next_state <= s8; output <= "000000100"; end if; when s8 => if std_match(input, "1-0---") then next_state <= s3; output <= "110000000"; elsif std_match(input, "1-10--") then next_state <= s3; output <= "110000000"; elsif std_match(input, "1-11--") then next_state <= s4; output <= "110000000"; end if; when s4 => if std_match(input, "1---1-") then next_state <= s13; output <= "000000010"; elsif std_match(input, "1---0-") then next_state <= s13; output <= "000000000"; end if; when s13 => if std_match(input, "1-----") then next_state <= s14; output <= "001000010"; end if; when s14 => if std_match(input, "1-----") then next_state <= s6; output <= "000000000"; end if; when s6 => if std_match(input, "10----") then next_state <= s6; output <= "000000000"; elsif std_match(input, "11----") then next_state <= s9; output <= "100110000"; end if; when s9 => if std_match(input, "1-----") then next_state <= s10; output <= "100100000"; end if; when s10 => if std_match(input, "1----1") then next_state <= s3; output <= "110000101"; elsif std_match(input, "1----0") then next_state <= s4; output <= "110000100"; end if; when others => next_state <= "----"; output <= "---------"; end case; end process; end behaviour;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2014, Aeroflex Gaisler -- Copyright (C) 2015 - 2016, Cobham Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ----------------------------------------------------------------------------- -- Entity: ahb2mig -- File: ahb2mig.vhd -- Author: Jiri Gaisler, Gaisler Research -- Description: AHB wrapper for Xilinx Virtex5 DDR2/3 MIG ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; library grlib; use grlib.amba.all; package ml50x is constant BANK_WIDTH : integer := 2; -- # of memory bank addr bits. constant CKE_WIDTH : integer := 2; -- # of memory clock enable outputs. constant CLK_WIDTH : integer := 2; -- # of clock outputs. constant COL_WIDTH : integer := 10; -- # of memory column bits. constant CS_NUM : integer := 1; --2; -- # of separate memory chip selects. constant CS_WIDTH : integer := 1; --2; -- # of total memory chip selects. constant CS_BITS : integer := 0; --1; -- set to log2(CS_NUM) (rounded up). constant DM_WIDTH : integer := 8; -- # of data mask bits. constant DQ_WIDTH : integer := 64; -- # of data width. constant DQ_PER_DQS : integer := 8; -- # of DQ data bits per strobe. constant DQS_WIDTH : integer := 8; -- # of DQS strobes. constant DQ_BITS : integer := 6; -- set to log2(DQS_WIDTH*DQ_PER_DQS). constant DQS_BITS : integer := 3; -- set to log2(DQS_WIDTH). constant ODT_WIDTH : integer := 1; -- # of memory on-die term enables. constant ROW_WIDTH : integer := 13; -- # of memory row and # of addr bits. constant APPDATA_WIDTH : integer := 128; -- # of usr read/write data bus bits. constant ADDR_WIDTH : integer := 31; -- # of memory row and # of addr bits. constant MIGHMASK : integer := 16#F00#; -- AHB mask for 256 Mbyte memory -- constant MIGHMASK : integer := 16#E00#; -- AHB mask for 512 Mbyte memory -- constant MIGHMASK : integer := 16#C00#; -- AHB mask for 1024 Mbyte memory type mig_app_in_type is record app_wdf_wren : std_logic; app_wdf_data : std_logic_vector(APPDATA_WIDTH-1 downto 0); app_wdf_mask : std_logic_vector(APPDATA_WIDTH/8-1 downto 0); app_addr : std_logic_vector(ADDR_WIDTH-1 downto 0); app_cmd : std_logic_vector(2 downto 0); app_en : std_logic; end record; type mig_app_out_type is record app_af_afull : std_logic; app_wdf_afull : std_logic; app_rd_data : std_logic_vector(APPDATA_WIDTH-1 downto 0); app_rd_data_valid : std_logic; end record; component mig_36_1 generic( BANK_WIDTH : integer := 2; -- # of memory bank addr bits. CKE_WIDTH : integer := 1; -- # of memory clock enable outputs. CLK_WIDTH : integer := 2; -- # of clock outputs. COL_WIDTH : integer := 10; -- # of memory column bits. CS_NUM : integer := 1; -- # of separate memory chip selects. CS_WIDTH : integer := 1; -- # of total memory chip selects. CS_BITS : integer := 0; -- set to log2(CS_NUM) (rounded up). DM_WIDTH : integer := 8; -- # of data mask bits. DQ_WIDTH : integer := 64; -- # of data width. DQ_PER_DQS : integer := 8; -- # of DQ data bits per strobe. DQS_WIDTH : integer := 8; -- # of DQS strobes. DQ_BITS : integer := 6; -- set to log2(DQS_WIDTH*DQ_PER_DQS). DQS_BITS : integer := 3; -- set to log2(DQS_WIDTH). ODT_WIDTH : integer := 1; -- # of memory on-die term enables. ROW_WIDTH : integer := 13; -- # of memory row and # of addr bits. ADDITIVE_LAT : integer := 0; -- additive write latency. BURST_LEN : integer := 4; -- burst length (in double words). BURST_TYPE : integer := 0; -- burst type (=0 seq; =1 interleaved). CAS_LAT : integer := 3; -- CAS latency. ECC_ENABLE : integer := 0; -- enable ECC (=1 enable). APPDATA_WIDTH : integer := 128; -- # of usr read/write data bus bits. MULTI_BANK_EN : integer := 1; -- Keeps multiple banks open. (= 1 enable). TWO_T_TIME_EN : integer := 1; -- 2t timing for unbuffered dimms. ODT_TYPE : integer := 1; -- ODT (=0(none),=1(75),=2(150),=3(50)). REDUCE_DRV : integer := 0; -- reduced strength mem I/O (=1 yes). REG_ENABLE : integer := 0; -- registered addr/ctrl (=1 yes). TREFI_NS : integer := 7800; -- auto refresh interval (ns). TRAS : integer := 40000; -- active->precharge delay. TRCD : integer := 15000; -- active->read/write delay. TRFC : integer := 105000; -- refresh->refresh, refresh->active delay. TRP : integer := 15000; -- precharge->command delay. TRTP : integer := 7500; -- read->precharge delay. TWR : integer := 15000; -- used to determine write->precharge. TWTR : integer := 10000; -- write->read delay. HIGH_PERFORMANCE_MODE : boolean := TRUE; -- # = TRUE, the IODELAY performance mode is set -- to high. -- # = FALSE, the IODELAY performance mode is set -- to low. SIM_ONLY : integer := 0; -- = 1 to skip SDRAM power up delay. DEBUG_EN : integer := 0; -- Enable debug signals/controls. -- When this parameter is changed from 0 to 1, -- make sure to uncomment the coregen commands -- in ise_flow.bat or create_ise.bat files in -- par folder. CLK_PERIOD : integer := 5000; -- Core/Memory clock period (in ps). DLL_FREQ_MODE : string := "HIGH"; -- DCM Frequency range. CLK_TYPE : string := "SINGLE_ENDED"; -- # = "DIFFERENTIAL " ->; Differential input clocks , -- # = "SINGLE_ENDED" -> Single ended input clocks. NOCLK200 : boolean := FALSE; -- clk200 enable and disable RST_ACT_LOW : integer := 1 -- =1 for active low reset, =0 for active high. ); port( ddr2_dq : inout std_logic_vector((DQ_WIDTH-1) downto 0); ddr2_a : out std_logic_vector((ROW_WIDTH-1) downto 0); ddr2_ba : out std_logic_vector((BANK_WIDTH-1) downto 0); ddr2_ras_n : out std_logic; ddr2_cas_n : out std_logic; ddr2_we_n : out std_logic; ddr2_cs_n : out std_logic_vector((CS_WIDTH-1) downto 0); ddr2_odt : out std_logic_vector((ODT_WIDTH-1) downto 0); ddr2_cke : out std_logic_vector((CKE_WIDTH-1) downto 0); ddr2_dm : out std_logic_vector((DM_WIDTH-1) downto 0); sys_clk : in std_logic; idly_clk_200 : in std_logic; sys_rst_n : in std_logic; phy_init_done : out std_logic; rst0_tb : out std_logic; clk0_tb : out std_logic; app_wdf_afull : out std_logic; app_af_afull : out std_logic; rd_data_valid : out std_logic; app_wdf_wren : in std_logic; app_af_wren : in std_logic; app_af_addr : in std_logic_vector(30 downto 0); app_af_cmd : in std_logic_vector(2 downto 0); rd_data_fifo_out : out std_logic_vector((APPDATA_WIDTH-1) downto 0); app_wdf_data : in std_logic_vector((APPDATA_WIDTH-1) downto 0); app_wdf_mask_data : in std_logic_vector((APPDATA_WIDTH/8-1) downto 0); ddr2_dqs : inout std_logic_vector((DQS_WIDTH-1) downto 0); ddr2_dqs_n : inout std_logic_vector((DQS_WIDTH-1) downto 0); ddr2_ck : out std_logic_vector((CLK_WIDTH-1) downto 0); ddr2_ck_n : out std_logic_vector((CLK_WIDTH-1) downto 0) ); end component ; end package; library ieee; use ieee.std_logic_1164.all; library grlib; use grlib.amba.all; use grlib.stdlib.all; library gaisler; use grlib.devices.all; use gaisler.memctrl.all; library techmap; use techmap.gencomp.all; use work.ml50x.all; entity ahb2mig_ml50x is generic ( memtech : integer := 0; hindex : integer := 0; haddr : integer := 0; hmask : integer := 16#e00#; MHz : integer := 100; Mbyte : integer := 512; nosync : integer := 0 ); port ( rst_ddr : in std_ulogic; rst_ahb : in std_ulogic; clk_ddr : in std_ulogic; clk_ahb : in std_ulogic; ahbsi : in ahb_slv_in_type; ahbso : out ahb_slv_out_type; migi : out mig_app_in_type; migo : in mig_app_out_type ); end; architecture rtl of ahb2mig_ml50x is constant REVISION : integer := 0; constant hconfig : ahb_config_type := ( 0 => ahb_device_reg ( VENDOR_GAISLER, GAISLER_MIGDDR2, 0, REVISION, 0), 4 => ahb_membar(haddr, '1', '1', hmask), others => zero32); type ahb_state_type is (midle, rhold, dread, dwrite, whold1, whold2); type ddr_state_type is (midle, rhold, dread, dwrite, whold1, whold2); constant abuf : integer := 6; type access_param is record haddr : std_logic_vector(31 downto 0); size : std_logic_vector(2 downto 0); hwrite : std_ulogic; end record; -- local registers type mem is array(0 to 7) of std_logic_vector(31 downto 0); type wrm is array(0 to 7) of std_logic_vector(3 downto 0); type ahb_reg_type is record hready : std_ulogic; hsel : std_ulogic; startsd : std_ulogic; state : ahb_state_type; haddr : std_logic_vector(31 downto 0); hrdata : std_logic_vector(127 downto 0); hwrite : std_ulogic; htrans : std_logic_vector(1 downto 0); hresp : std_logic_vector(1 downto 0); raddr : std_logic_vector(abuf-1 downto 0); size : std_logic_vector(2 downto 0); acc : access_param; sync : std_ulogic; hwdata : mem; write : wrm; end record; type ddr_reg_type is record startsd : std_ulogic; hrdata : std_logic_vector(255 downto 0); sync : std_ulogic; dstate : ahb_state_type; end record; signal vcc, clk_ahb1, clk_ahb2 : std_ulogic; signal r, ri : ddr_reg_type; signal ra, rai : ahb_reg_type; signal rbdrive, ribdrive : std_logic_vector(31 downto 0); signal hwdata, hwdatab : std_logic_vector(127 downto 0); begin vcc <= '1'; ahb_ctrl : process(rst_ahb, ahbsi, r, ra, migo, hwdata) variable va : ahb_reg_type; -- local variables for registers variable startsd : std_ulogic; variable ready : std_logic; variable tmp : std_logic_vector(3 downto 0); variable waddr : integer; variable rdata : std_logic_vector(127 downto 0); begin va := ra; va.hresp := HRESP_OKAY; tmp := (others => '0'); case ra.raddr(2 downto 2) is when "0" => rdata := r.hrdata(127 downto 0); when others => rdata := r.hrdata(255 downto 128); end case; if AHBDW > 64 and ra.size = HSIZE_4WORD then va.hrdata := rdata(63 downto 0) & rdata(127 downto 64); elsif AHBDW > 32 and ra.size = HSIZE_DWORD then if ra.raddr(1) = '1' then va.hrdata(63 downto 0) := rdata(127 downto 64); else va.hrdata(63 downto 0) := rdata(63 downto 0); end if; va.hrdata(127 downto 64) := va.hrdata(63 downto 0); else case ra.raddr(1 downto 0) is when "00" => va.hrdata(31 downto 0) := rdata(63 downto 32); when "01" => va.hrdata(31 downto 0) := rdata(31 downto 0); when "10" => va.hrdata(31 downto 0) := rdata(127 downto 96); when others => va.hrdata(31 downto 0) := rdata(95 downto 64); end case; va.hrdata(127 downto 32) := va.hrdata(31 downto 0) & va.hrdata(31 downto 0) & va.hrdata(31 downto 0); end if; if nosync = 0 then va.sync := r.startsd; if ra.startsd = ra.sync then ready := '1'; else ready := '0'; end if; else if ra.startsd = r.startsd then ready := '1'; else ready := '0'; end if; end if; if ((ahbsi.hready and ahbsi.hsel(hindex)) = '1') then va.htrans := ahbsi.htrans; va.haddr := ahbsi.haddr; va.size := ahbsi.hsize(2 downto 0); va.hwrite := ahbsi.hwrite; if ahbsi.htrans(1) = '1' then va.hsel := '1'; va.hready := '0'; end if; end if; if ahbsi.hready = '1' then va.hsel := ahbsi.hsel(hindex); end if; case ra.state is when midle => va.write := (others => "0000"); if ((va.hsel and va.htrans(1)) = '1') then if va.hwrite = '0' then va.state := rhold; va.startsd := not ra.startsd; else va.state := dwrite; va.hready := '1'; end if; end if; va.raddr := ra.haddr(7 downto 2); if ((ahbsi.hready and ahbsi.hsel(hindex)) = '1') then va.acc := (va.haddr, va.size, va.hwrite); end if; when rhold => va.raddr := ra.haddr(7 downto 2); if ready = '1' then va.state := dread; va.hready := '1'; if AHBDW > 64 and ra.size(2) = '1' then va.raddr := ra.raddr + 4; elsif AHBDW > 32 and andv(ra.size(1 downto 0)) = '1' then va.raddr := ra.raddr + 2; else va.raddr := ra.raddr + 1; end if; end if; when dread => va.hready := '1'; if AHBDW > 64 and ra.size(2) = '1' then va.raddr := ra.raddr + 4; elsif AHBDW > 32 and andv(ra.size(1 downto 0)) = '1' then va.raddr := ra.raddr + 2; else va.raddr := ra.raddr + 1; end if; if ((va.hsel and va.htrans(1) and va.htrans(0)) = '0') or (ra.raddr(2 downto 0) = "000") then va.state := midle; va.hready := '0'; end if; va.acc := (va.haddr, va.size, va.hwrite); when dwrite => va.raddr := ra.haddr(7 downto 2); va.hready := '1'; if (((va.hsel and va.htrans(1) and va.htrans(0)) = '0') or (ra.haddr(4 downto 2) = "111") or (AHBDW > 32 and ra.haddr(5 downto 2) = "1110" and andv(ra.size(1 downto 0)) = '1') or (AHBDW > 64 and ra.haddr(5 downto 2) = "1100" and ra.size(2) = '1')) then va.startsd := not ra.startsd; va.state := whold1; va.hready := '0'; end if; tmp := decode(ra.haddr(1 downto 0)); waddr := conv_integer(ra.haddr(4 downto 2)); va.hwdata(waddr) := hwdata(31 downto 0); case ra.size is when "000" => va.write(waddr) := tmp(0) & tmp(1) & tmp(2) & tmp(3); when "001" => va.write(waddr) := tmp(0) & tmp(0) & tmp(2) & tmp(2); when "010" => va.write(waddr) := "1111"; when "011" => va.write(waddr) := "1111"; va.write(waddr+1) := "1111"; va.hwdata(waddr+1) := hwdata((63 mod AHBDW) downto (32 mod AHBDW)); when others => va.write(waddr) := "1111"; va.write(waddr+1) := "1111"; va.write(waddr+2) := "1111"; va.write(waddr+3) := "1111"; va.hwdata(waddr+1) := hwdata((63 mod AHBDW) downto (32 mod AHBDW)); va.hwdata(waddr+2) := hwdata((95 mod AHBDW) downto (64 mod AHBDW)); va.hwdata(waddr+3) := hwdata((127 mod AHBDW) downto (96 mod AHBDW)); end case; when whold1 => va.state := whold2; when whold2 => if ready = '1' then va.state := midle; va.acc := (va.haddr, va.size, va.hwrite); end if; end case; if (ahbsi.hready and ahbsi.hsel(hindex) ) = '1' then if ahbsi.htrans(1) = '0' then va.hready := '1'; end if; end if; if rst_ahb = '0' then va.hsel := '0'; va.hready := '1'; va.state := midle; va.startsd := '0'; va.acc.hwrite := '0'; va.acc.haddr := (others => '0'); end if; rai <= va; end process; ahbso.hready <= ra.hready; ahbso.hresp <= ra.hresp; ahbso.hrdata <= ahbdrivedata(ra.hrdata); -- migi.app_addr <= '0' & ra.acc.haddr(28 downto 6) & "000"; migi.app_addr <= "00000" & ra.acc.haddr(28 downto 5) & "00"; ddr_ctrl : process(rst_ddr, r, ra, migo) variable v : ddr_reg_type; -- local variables for registers variable startsd : std_ulogic; variable raddr : std_logic_vector(13 downto 0); variable adec : std_ulogic; variable haddr : std_logic_vector(31 downto 0); variable hsize : std_logic_vector(1 downto 0); variable hwrite : std_ulogic; variable htrans : std_logic_vector(1 downto 0); variable hready : std_ulogic; variable app_en : std_ulogic; variable app_cmd : std_logic_vector(2 downto 0); variable app_wdf_mask : std_logic_vector(APPDATA_WIDTH/8-1 downto 0); variable app_wdf_wren : std_ulogic; variable app_wdf_data : std_logic_vector(APPDATA_WIDTH-1 downto 0); begin -- Variable default settings to avoid latches v := r; app_en := '0'; app_cmd := "000"; app_wdf_wren := '0'; app_wdf_mask := (others => '0'); app_wdf_mask(15 downto 0) := ra.write(2) & ra.write(3) & ra.write(0) & ra.write(1); app_wdf_data := (others => '0'); app_wdf_data(127 downto 0) := ra.hwdata(2) & ra.hwdata(3) & ra.hwdata(0) & ra.hwdata(1); if ra.acc.hwrite = '0' then app_cmd(0) := '1'; else app_cmd(0) := '0'; end if; v.sync := ra.startsd; if nosync = 0 then if r.startsd /= r.sync then startsd := '1'; else startsd := '0'; end if; else if ra.startsd /= r.startsd then startsd := '1'; else startsd := '0'; end if; end if; case r.dstate is when midle => if (startsd = '1') and (migo.app_af_afull = '0') then if ra.acc.hwrite = '0' then v.dstate := dread; app_en := '1'; elsif migo.app_wdf_afull = '0' then v.dstate := dwrite; app_en := '1'; app_wdf_wren := '1'; end if; end if; when dread => if migo.app_rd_data_valid = '1' then v.hrdata(127 downto 0) := migo.app_rd_data(127 downto 0); v.dstate := rhold; end if; when rhold => v.hrdata(255 downto 128) := migo.app_rd_data(127 downto 0); v.dstate := midle; v.startsd := not r.startsd; when dwrite => app_wdf_wren := '1'; app_wdf_mask(15 downto 0) := ra.write(6) & ra.write(7) & ra.write(4) & ra.write(5); app_wdf_data(127 downto 0) := ra.hwdata(6) & ra.hwdata(7) & ra.hwdata(4) & ra.hwdata(5); v.startsd := not r.startsd; v.dstate := midle; when others => end case; -- reset if rst_ddr = '0' then v.startsd := '0'; app_en := '0'; v.dstate := midle; end if; ri <= v; migi.app_cmd <= app_cmd; migi.app_en <= app_en; migi.app_wdf_wren <= app_wdf_wren; migi.app_wdf_mask <= not app_wdf_mask; migi.app_wdf_data <= app_wdf_data; end process; ahbso.hconfig <= hconfig; ahbso.hirq <= (others => '0'); ahbso.hindex <= hindex; ahbso.hsplit <= (others => '0'); clk_ahb1 <= clk_ahb; clk_ahb2 <= clk_ahb1; -- sync clock deltas ahbregs : process(clk_ahb2) begin if rising_edge(clk_ahb2) then ra <= rai; end if; end process; ddrregs : process(clk_ddr) begin if rising_edge(clk_ddr) then r <= ri; end if; end process; -- Write data selection. AHB32: if AHBDW = 32 generate hwdata <= ahbsi.hwdata(31 downto 0) & ahbsi.hwdata(31 downto 0) & ahbsi.hwdata(31 downto 0) & ahbsi.hwdata(31 downto 0); end generate AHB32; AHB64: if AHBDW = 64 generate -- With CORE_ACDM set to 0 hwdata will always be ahbsi.hwdata(63 downto 0) -- otherwise the valid data slice will be selected, and possibly uplicated, -- from ahbsi.hwdata. hwdatab(63 downto 0) <= ahbreaddword(ahbsi.hwdata, ra.haddr(4 downto 2)) when (CORE_ACDM = 0 or ra.size(1 downto 0) = "11") else (ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2))); hwdata <= hwdatab(31 downto 0) & hwdatab(63 downto 32) & hwdatab(31 downto 0) & hwdatab(63 downto 32); end generate AHB64; AHBWIDE: if AHBDW > 64 generate -- With CORE_ACDM set to 0 hwdata will always be ahbsi.hwdata(127 downto 0) -- otherwise the valid data slice will be selected, and possibly uplicated, -- from ahbsi.hwdata. hwdatab <= ahbread4word(ahbsi.hwdata, ra.haddr(4 downto 2)) when (CORE_ACDM = 0 or ra.size(2) = '1') else (ahbreaddword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreaddword(ahbsi.hwdata, ra.haddr(4 downto 2))) when (ra.size = "011") else (ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2))); hwdata <= hwdatab(31 downto 0) & hwdatab(63 downto 32) & hwdatab(95 downto 64) & hwdatab(127 downto 96); end generate AHBWIDE; -- pragma translate_off bootmsg : report_version generic map ( msg1 => "ahb2mig" & tost(hindex) & ": 64-bit DDR2/3 controller rev " & tost(REVISION) & ", " & tost(Mbyte) & " Mbyte, " & tost(MHz) & " MHz DDR clock"); -- pragma translate_on end;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2014, Aeroflex Gaisler -- Copyright (C) 2015 - 2016, Cobham Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ----------------------------------------------------------------------------- -- Entity: ahb2mig -- File: ahb2mig.vhd -- Author: Jiri Gaisler, Gaisler Research -- Description: AHB wrapper for Xilinx Virtex5 DDR2/3 MIG ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; library grlib; use grlib.amba.all; package ml50x is constant BANK_WIDTH : integer := 2; -- # of memory bank addr bits. constant CKE_WIDTH : integer := 2; -- # of memory clock enable outputs. constant CLK_WIDTH : integer := 2; -- # of clock outputs. constant COL_WIDTH : integer := 10; -- # of memory column bits. constant CS_NUM : integer := 1; --2; -- # of separate memory chip selects. constant CS_WIDTH : integer := 1; --2; -- # of total memory chip selects. constant CS_BITS : integer := 0; --1; -- set to log2(CS_NUM) (rounded up). constant DM_WIDTH : integer := 8; -- # of data mask bits. constant DQ_WIDTH : integer := 64; -- # of data width. constant DQ_PER_DQS : integer := 8; -- # of DQ data bits per strobe. constant DQS_WIDTH : integer := 8; -- # of DQS strobes. constant DQ_BITS : integer := 6; -- set to log2(DQS_WIDTH*DQ_PER_DQS). constant DQS_BITS : integer := 3; -- set to log2(DQS_WIDTH). constant ODT_WIDTH : integer := 1; -- # of memory on-die term enables. constant ROW_WIDTH : integer := 13; -- # of memory row and # of addr bits. constant APPDATA_WIDTH : integer := 128; -- # of usr read/write data bus bits. constant ADDR_WIDTH : integer := 31; -- # of memory row and # of addr bits. constant MIGHMASK : integer := 16#F00#; -- AHB mask for 256 Mbyte memory -- constant MIGHMASK : integer := 16#E00#; -- AHB mask for 512 Mbyte memory -- constant MIGHMASK : integer := 16#C00#; -- AHB mask for 1024 Mbyte memory type mig_app_in_type is record app_wdf_wren : std_logic; app_wdf_data : std_logic_vector(APPDATA_WIDTH-1 downto 0); app_wdf_mask : std_logic_vector(APPDATA_WIDTH/8-1 downto 0); app_addr : std_logic_vector(ADDR_WIDTH-1 downto 0); app_cmd : std_logic_vector(2 downto 0); app_en : std_logic; end record; type mig_app_out_type is record app_af_afull : std_logic; app_wdf_afull : std_logic; app_rd_data : std_logic_vector(APPDATA_WIDTH-1 downto 0); app_rd_data_valid : std_logic; end record; component mig_36_1 generic( BANK_WIDTH : integer := 2; -- # of memory bank addr bits. CKE_WIDTH : integer := 1; -- # of memory clock enable outputs. CLK_WIDTH : integer := 2; -- # of clock outputs. COL_WIDTH : integer := 10; -- # of memory column bits. CS_NUM : integer := 1; -- # of separate memory chip selects. CS_WIDTH : integer := 1; -- # of total memory chip selects. CS_BITS : integer := 0; -- set to log2(CS_NUM) (rounded up). DM_WIDTH : integer := 8; -- # of data mask bits. DQ_WIDTH : integer := 64; -- # of data width. DQ_PER_DQS : integer := 8; -- # of DQ data bits per strobe. DQS_WIDTH : integer := 8; -- # of DQS strobes. DQ_BITS : integer := 6; -- set to log2(DQS_WIDTH*DQ_PER_DQS). DQS_BITS : integer := 3; -- set to log2(DQS_WIDTH). ODT_WIDTH : integer := 1; -- # of memory on-die term enables. ROW_WIDTH : integer := 13; -- # of memory row and # of addr bits. ADDITIVE_LAT : integer := 0; -- additive write latency. BURST_LEN : integer := 4; -- burst length (in double words). BURST_TYPE : integer := 0; -- burst type (=0 seq; =1 interleaved). CAS_LAT : integer := 3; -- CAS latency. ECC_ENABLE : integer := 0; -- enable ECC (=1 enable). APPDATA_WIDTH : integer := 128; -- # of usr read/write data bus bits. MULTI_BANK_EN : integer := 1; -- Keeps multiple banks open. (= 1 enable). TWO_T_TIME_EN : integer := 1; -- 2t timing for unbuffered dimms. ODT_TYPE : integer := 1; -- ODT (=0(none),=1(75),=2(150),=3(50)). REDUCE_DRV : integer := 0; -- reduced strength mem I/O (=1 yes). REG_ENABLE : integer := 0; -- registered addr/ctrl (=1 yes). TREFI_NS : integer := 7800; -- auto refresh interval (ns). TRAS : integer := 40000; -- active->precharge delay. TRCD : integer := 15000; -- active->read/write delay. TRFC : integer := 105000; -- refresh->refresh, refresh->active delay. TRP : integer := 15000; -- precharge->command delay. TRTP : integer := 7500; -- read->precharge delay. TWR : integer := 15000; -- used to determine write->precharge. TWTR : integer := 10000; -- write->read delay. HIGH_PERFORMANCE_MODE : boolean := TRUE; -- # = TRUE, the IODELAY performance mode is set -- to high. -- # = FALSE, the IODELAY performance mode is set -- to low. SIM_ONLY : integer := 0; -- = 1 to skip SDRAM power up delay. DEBUG_EN : integer := 0; -- Enable debug signals/controls. -- When this parameter is changed from 0 to 1, -- make sure to uncomment the coregen commands -- in ise_flow.bat or create_ise.bat files in -- par folder. CLK_PERIOD : integer := 5000; -- Core/Memory clock period (in ps). DLL_FREQ_MODE : string := "HIGH"; -- DCM Frequency range. CLK_TYPE : string := "SINGLE_ENDED"; -- # = "DIFFERENTIAL " ->; Differential input clocks , -- # = "SINGLE_ENDED" -> Single ended input clocks. NOCLK200 : boolean := FALSE; -- clk200 enable and disable RST_ACT_LOW : integer := 1 -- =1 for active low reset, =0 for active high. ); port( ddr2_dq : inout std_logic_vector((DQ_WIDTH-1) downto 0); ddr2_a : out std_logic_vector((ROW_WIDTH-1) downto 0); ddr2_ba : out std_logic_vector((BANK_WIDTH-1) downto 0); ddr2_ras_n : out std_logic; ddr2_cas_n : out std_logic; ddr2_we_n : out std_logic; ddr2_cs_n : out std_logic_vector((CS_WIDTH-1) downto 0); ddr2_odt : out std_logic_vector((ODT_WIDTH-1) downto 0); ddr2_cke : out std_logic_vector((CKE_WIDTH-1) downto 0); ddr2_dm : out std_logic_vector((DM_WIDTH-1) downto 0); sys_clk : in std_logic; idly_clk_200 : in std_logic; sys_rst_n : in std_logic; phy_init_done : out std_logic; rst0_tb : out std_logic; clk0_tb : out std_logic; app_wdf_afull : out std_logic; app_af_afull : out std_logic; rd_data_valid : out std_logic; app_wdf_wren : in std_logic; app_af_wren : in std_logic; app_af_addr : in std_logic_vector(30 downto 0); app_af_cmd : in std_logic_vector(2 downto 0); rd_data_fifo_out : out std_logic_vector((APPDATA_WIDTH-1) downto 0); app_wdf_data : in std_logic_vector((APPDATA_WIDTH-1) downto 0); app_wdf_mask_data : in std_logic_vector((APPDATA_WIDTH/8-1) downto 0); ddr2_dqs : inout std_logic_vector((DQS_WIDTH-1) downto 0); ddr2_dqs_n : inout std_logic_vector((DQS_WIDTH-1) downto 0); ddr2_ck : out std_logic_vector((CLK_WIDTH-1) downto 0); ddr2_ck_n : out std_logic_vector((CLK_WIDTH-1) downto 0) ); end component ; end package; library ieee; use ieee.std_logic_1164.all; library grlib; use grlib.amba.all; use grlib.stdlib.all; library gaisler; use grlib.devices.all; use gaisler.memctrl.all; library techmap; use techmap.gencomp.all; use work.ml50x.all; entity ahb2mig_ml50x is generic ( memtech : integer := 0; hindex : integer := 0; haddr : integer := 0; hmask : integer := 16#e00#; MHz : integer := 100; Mbyte : integer := 512; nosync : integer := 0 ); port ( rst_ddr : in std_ulogic; rst_ahb : in std_ulogic; clk_ddr : in std_ulogic; clk_ahb : in std_ulogic; ahbsi : in ahb_slv_in_type; ahbso : out ahb_slv_out_type; migi : out mig_app_in_type; migo : in mig_app_out_type ); end; architecture rtl of ahb2mig_ml50x is constant REVISION : integer := 0; constant hconfig : ahb_config_type := ( 0 => ahb_device_reg ( VENDOR_GAISLER, GAISLER_MIGDDR2, 0, REVISION, 0), 4 => ahb_membar(haddr, '1', '1', hmask), others => zero32); type ahb_state_type is (midle, rhold, dread, dwrite, whold1, whold2); type ddr_state_type is (midle, rhold, dread, dwrite, whold1, whold2); constant abuf : integer := 6; type access_param is record haddr : std_logic_vector(31 downto 0); size : std_logic_vector(2 downto 0); hwrite : std_ulogic; end record; -- local registers type mem is array(0 to 7) of std_logic_vector(31 downto 0); type wrm is array(0 to 7) of std_logic_vector(3 downto 0); type ahb_reg_type is record hready : std_ulogic; hsel : std_ulogic; startsd : std_ulogic; state : ahb_state_type; haddr : std_logic_vector(31 downto 0); hrdata : std_logic_vector(127 downto 0); hwrite : std_ulogic; htrans : std_logic_vector(1 downto 0); hresp : std_logic_vector(1 downto 0); raddr : std_logic_vector(abuf-1 downto 0); size : std_logic_vector(2 downto 0); acc : access_param; sync : std_ulogic; hwdata : mem; write : wrm; end record; type ddr_reg_type is record startsd : std_ulogic; hrdata : std_logic_vector(255 downto 0); sync : std_ulogic; dstate : ahb_state_type; end record; signal vcc, clk_ahb1, clk_ahb2 : std_ulogic; signal r, ri : ddr_reg_type; signal ra, rai : ahb_reg_type; signal rbdrive, ribdrive : std_logic_vector(31 downto 0); signal hwdata, hwdatab : std_logic_vector(127 downto 0); begin vcc <= '1'; ahb_ctrl : process(rst_ahb, ahbsi, r, ra, migo, hwdata) variable va : ahb_reg_type; -- local variables for registers variable startsd : std_ulogic; variable ready : std_logic; variable tmp : std_logic_vector(3 downto 0); variable waddr : integer; variable rdata : std_logic_vector(127 downto 0); begin va := ra; va.hresp := HRESP_OKAY; tmp := (others => '0'); case ra.raddr(2 downto 2) is when "0" => rdata := r.hrdata(127 downto 0); when others => rdata := r.hrdata(255 downto 128); end case; if AHBDW > 64 and ra.size = HSIZE_4WORD then va.hrdata := rdata(63 downto 0) & rdata(127 downto 64); elsif AHBDW > 32 and ra.size = HSIZE_DWORD then if ra.raddr(1) = '1' then va.hrdata(63 downto 0) := rdata(127 downto 64); else va.hrdata(63 downto 0) := rdata(63 downto 0); end if; va.hrdata(127 downto 64) := va.hrdata(63 downto 0); else case ra.raddr(1 downto 0) is when "00" => va.hrdata(31 downto 0) := rdata(63 downto 32); when "01" => va.hrdata(31 downto 0) := rdata(31 downto 0); when "10" => va.hrdata(31 downto 0) := rdata(127 downto 96); when others => va.hrdata(31 downto 0) := rdata(95 downto 64); end case; va.hrdata(127 downto 32) := va.hrdata(31 downto 0) & va.hrdata(31 downto 0) & va.hrdata(31 downto 0); end if; if nosync = 0 then va.sync := r.startsd; if ra.startsd = ra.sync then ready := '1'; else ready := '0'; end if; else if ra.startsd = r.startsd then ready := '1'; else ready := '0'; end if; end if; if ((ahbsi.hready and ahbsi.hsel(hindex)) = '1') then va.htrans := ahbsi.htrans; va.haddr := ahbsi.haddr; va.size := ahbsi.hsize(2 downto 0); va.hwrite := ahbsi.hwrite; if ahbsi.htrans(1) = '1' then va.hsel := '1'; va.hready := '0'; end if; end if; if ahbsi.hready = '1' then va.hsel := ahbsi.hsel(hindex); end if; case ra.state is when midle => va.write := (others => "0000"); if ((va.hsel and va.htrans(1)) = '1') then if va.hwrite = '0' then va.state := rhold; va.startsd := not ra.startsd; else va.state := dwrite; va.hready := '1'; end if; end if; va.raddr := ra.haddr(7 downto 2); if ((ahbsi.hready and ahbsi.hsel(hindex)) = '1') then va.acc := (va.haddr, va.size, va.hwrite); end if; when rhold => va.raddr := ra.haddr(7 downto 2); if ready = '1' then va.state := dread; va.hready := '1'; if AHBDW > 64 and ra.size(2) = '1' then va.raddr := ra.raddr + 4; elsif AHBDW > 32 and andv(ra.size(1 downto 0)) = '1' then va.raddr := ra.raddr + 2; else va.raddr := ra.raddr + 1; end if; end if; when dread => va.hready := '1'; if AHBDW > 64 and ra.size(2) = '1' then va.raddr := ra.raddr + 4; elsif AHBDW > 32 and andv(ra.size(1 downto 0)) = '1' then va.raddr := ra.raddr + 2; else va.raddr := ra.raddr + 1; end if; if ((va.hsel and va.htrans(1) and va.htrans(0)) = '0') or (ra.raddr(2 downto 0) = "000") then va.state := midle; va.hready := '0'; end if; va.acc := (va.haddr, va.size, va.hwrite); when dwrite => va.raddr := ra.haddr(7 downto 2); va.hready := '1'; if (((va.hsel and va.htrans(1) and va.htrans(0)) = '0') or (ra.haddr(4 downto 2) = "111") or (AHBDW > 32 and ra.haddr(5 downto 2) = "1110" and andv(ra.size(1 downto 0)) = '1') or (AHBDW > 64 and ra.haddr(5 downto 2) = "1100" and ra.size(2) = '1')) then va.startsd := not ra.startsd; va.state := whold1; va.hready := '0'; end if; tmp := decode(ra.haddr(1 downto 0)); waddr := conv_integer(ra.haddr(4 downto 2)); va.hwdata(waddr) := hwdata(31 downto 0); case ra.size is when "000" => va.write(waddr) := tmp(0) & tmp(1) & tmp(2) & tmp(3); when "001" => va.write(waddr) := tmp(0) & tmp(0) & tmp(2) & tmp(2); when "010" => va.write(waddr) := "1111"; when "011" => va.write(waddr) := "1111"; va.write(waddr+1) := "1111"; va.hwdata(waddr+1) := hwdata((63 mod AHBDW) downto (32 mod AHBDW)); when others => va.write(waddr) := "1111"; va.write(waddr+1) := "1111"; va.write(waddr+2) := "1111"; va.write(waddr+3) := "1111"; va.hwdata(waddr+1) := hwdata((63 mod AHBDW) downto (32 mod AHBDW)); va.hwdata(waddr+2) := hwdata((95 mod AHBDW) downto (64 mod AHBDW)); va.hwdata(waddr+3) := hwdata((127 mod AHBDW) downto (96 mod AHBDW)); end case; when whold1 => va.state := whold2; when whold2 => if ready = '1' then va.state := midle; va.acc := (va.haddr, va.size, va.hwrite); end if; end case; if (ahbsi.hready and ahbsi.hsel(hindex) ) = '1' then if ahbsi.htrans(1) = '0' then va.hready := '1'; end if; end if; if rst_ahb = '0' then va.hsel := '0'; va.hready := '1'; va.state := midle; va.startsd := '0'; va.acc.hwrite := '0'; va.acc.haddr := (others => '0'); end if; rai <= va; end process; ahbso.hready <= ra.hready; ahbso.hresp <= ra.hresp; ahbso.hrdata <= ahbdrivedata(ra.hrdata); -- migi.app_addr <= '0' & ra.acc.haddr(28 downto 6) & "000"; migi.app_addr <= "00000" & ra.acc.haddr(28 downto 5) & "00"; ddr_ctrl : process(rst_ddr, r, ra, migo) variable v : ddr_reg_type; -- local variables for registers variable startsd : std_ulogic; variable raddr : std_logic_vector(13 downto 0); variable adec : std_ulogic; variable haddr : std_logic_vector(31 downto 0); variable hsize : std_logic_vector(1 downto 0); variable hwrite : std_ulogic; variable htrans : std_logic_vector(1 downto 0); variable hready : std_ulogic; variable app_en : std_ulogic; variable app_cmd : std_logic_vector(2 downto 0); variable app_wdf_mask : std_logic_vector(APPDATA_WIDTH/8-1 downto 0); variable app_wdf_wren : std_ulogic; variable app_wdf_data : std_logic_vector(APPDATA_WIDTH-1 downto 0); begin -- Variable default settings to avoid latches v := r; app_en := '0'; app_cmd := "000"; app_wdf_wren := '0'; app_wdf_mask := (others => '0'); app_wdf_mask(15 downto 0) := ra.write(2) & ra.write(3) & ra.write(0) & ra.write(1); app_wdf_data := (others => '0'); app_wdf_data(127 downto 0) := ra.hwdata(2) & ra.hwdata(3) & ra.hwdata(0) & ra.hwdata(1); if ra.acc.hwrite = '0' then app_cmd(0) := '1'; else app_cmd(0) := '0'; end if; v.sync := ra.startsd; if nosync = 0 then if r.startsd /= r.sync then startsd := '1'; else startsd := '0'; end if; else if ra.startsd /= r.startsd then startsd := '1'; else startsd := '0'; end if; end if; case r.dstate is when midle => if (startsd = '1') and (migo.app_af_afull = '0') then if ra.acc.hwrite = '0' then v.dstate := dread; app_en := '1'; elsif migo.app_wdf_afull = '0' then v.dstate := dwrite; app_en := '1'; app_wdf_wren := '1'; end if; end if; when dread => if migo.app_rd_data_valid = '1' then v.hrdata(127 downto 0) := migo.app_rd_data(127 downto 0); v.dstate := rhold; end if; when rhold => v.hrdata(255 downto 128) := migo.app_rd_data(127 downto 0); v.dstate := midle; v.startsd := not r.startsd; when dwrite => app_wdf_wren := '1'; app_wdf_mask(15 downto 0) := ra.write(6) & ra.write(7) & ra.write(4) & ra.write(5); app_wdf_data(127 downto 0) := ra.hwdata(6) & ra.hwdata(7) & ra.hwdata(4) & ra.hwdata(5); v.startsd := not r.startsd; v.dstate := midle; when others => end case; -- reset if rst_ddr = '0' then v.startsd := '0'; app_en := '0'; v.dstate := midle; end if; ri <= v; migi.app_cmd <= app_cmd; migi.app_en <= app_en; migi.app_wdf_wren <= app_wdf_wren; migi.app_wdf_mask <= not app_wdf_mask; migi.app_wdf_data <= app_wdf_data; end process; ahbso.hconfig <= hconfig; ahbso.hirq <= (others => '0'); ahbso.hindex <= hindex; ahbso.hsplit <= (others => '0'); clk_ahb1 <= clk_ahb; clk_ahb2 <= clk_ahb1; -- sync clock deltas ahbregs : process(clk_ahb2) begin if rising_edge(clk_ahb2) then ra <= rai; end if; end process; ddrregs : process(clk_ddr) begin if rising_edge(clk_ddr) then r <= ri; end if; end process; -- Write data selection. AHB32: if AHBDW = 32 generate hwdata <= ahbsi.hwdata(31 downto 0) & ahbsi.hwdata(31 downto 0) & ahbsi.hwdata(31 downto 0) & ahbsi.hwdata(31 downto 0); end generate AHB32; AHB64: if AHBDW = 64 generate -- With CORE_ACDM set to 0 hwdata will always be ahbsi.hwdata(63 downto 0) -- otherwise the valid data slice will be selected, and possibly uplicated, -- from ahbsi.hwdata. hwdatab(63 downto 0) <= ahbreaddword(ahbsi.hwdata, ra.haddr(4 downto 2)) when (CORE_ACDM = 0 or ra.size(1 downto 0) = "11") else (ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2))); hwdata <= hwdatab(31 downto 0) & hwdatab(63 downto 32) & hwdatab(31 downto 0) & hwdatab(63 downto 32); end generate AHB64; AHBWIDE: if AHBDW > 64 generate -- With CORE_ACDM set to 0 hwdata will always be ahbsi.hwdata(127 downto 0) -- otherwise the valid data slice will be selected, and possibly uplicated, -- from ahbsi.hwdata. hwdatab <= ahbread4word(ahbsi.hwdata, ra.haddr(4 downto 2)) when (CORE_ACDM = 0 or ra.size(2) = '1') else (ahbreaddword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreaddword(ahbsi.hwdata, ra.haddr(4 downto 2))) when (ra.size = "011") else (ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2)) & ahbreadword(ahbsi.hwdata, ra.haddr(4 downto 2))); hwdata <= hwdatab(31 downto 0) & hwdatab(63 downto 32) & hwdatab(95 downto 64) & hwdatab(127 downto 96); end generate AHBWIDE; -- pragma translate_off bootmsg : report_version generic map ( msg1 => "ahb2mig" & tost(hindex) & ": 64-bit DDR2/3 controller rev " & tost(REVISION) & ", " & tost(Mbyte) & " Mbyte, " & tost(MHz) & " MHz DDR clock"); -- pragma translate_on end;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.2 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity fir is port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; y : OUT STD_LOGIC_VECTOR (31 downto 0); y_ap_vld : OUT STD_LOGIC; c_address0 : OUT STD_LOGIC_VECTOR (3 downto 0); c_ce0 : OUT STD_LOGIC; c_q0 : IN STD_LOGIC_VECTOR (31 downto 0); x : IN STD_LOGIC_VECTOR (31 downto 0) ); end; architecture behav of fir is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "fir,hls_ip_2017_2,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7k160tfbg484-2,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.714000,HLS_SYN_LAT=45,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=4,HLS_SYN_FF=329,HLS_SYN_LUT=214}"; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_logic_0 : STD_LOGIC := '0'; constant ap_ST_fsm_state1 : STD_LOGIC_VECTOR (4 downto 0) := "00001"; constant ap_ST_fsm_state2 : STD_LOGIC_VECTOR (4 downto 0) := "00010"; constant ap_ST_fsm_state3 : STD_LOGIC_VECTOR (4 downto 0) := "00100"; constant ap_ST_fsm_state4 : STD_LOGIC_VECTOR (4 downto 0) := "01000"; constant ap_ST_fsm_state5 : STD_LOGIC_VECTOR (4 downto 0) := "10000"; constant ap_const_lv32_0 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000000"; constant ap_const_lv32_1 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000001"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_lv32_2 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000010"; constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011"; constant ap_const_lv32_4 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000100"; constant ap_const_lv5_A : STD_LOGIC_VECTOR (4 downto 0) := "01010"; constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1"; constant ap_const_lv4_0 : STD_LOGIC_VECTOR (3 downto 0) := "0000"; constant ap_const_lv5_1F : STD_LOGIC_VECTOR (4 downto 0) := "11111"; constant ap_const_lv5_0 : STD_LOGIC_VECTOR (4 downto 0) := "00000"; constant ap_const_boolean_1 : BOOLEAN := true; signal ap_CS_fsm : STD_LOGIC_VECTOR (4 downto 0) := "00001"; attribute fsm_encoding : string; attribute fsm_encoding of ap_CS_fsm : signal is "none"; signal ap_CS_fsm_state1 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state1 : signal is "none"; signal shift_reg_address0 : STD_LOGIC_VECTOR (3 downto 0); signal shift_reg_ce0 : STD_LOGIC; signal shift_reg_we0 : STD_LOGIC; signal shift_reg_d0 : STD_LOGIC_VECTOR (31 downto 0); signal shift_reg_q0 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_fu_130_p1 : STD_LOGIC_VECTOR (31 downto 0); signal i_cast_reg_178 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state2 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state2 : signal is "none"; signal tmp_1_fu_142_p2 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_1_reg_187 : STD_LOGIC_VECTOR (0 downto 0); signal tmp_fu_134_p3 : STD_LOGIC_VECTOR (0 downto 0); signal ap_CS_fsm_state3 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state3 : signal is "none"; signal grp_fu_123_p2 : STD_LOGIC_VECTOR (4 downto 0); signal i_1_reg_206 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p2 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_6_reg_211 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state4 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state4 : signal is "none"; signal acc_1_fu_167_p2 : STD_LOGIC_VECTOR (31 downto 0); signal ap_CS_fsm_state5 : STD_LOGIC; attribute fsm_encoding of ap_CS_fsm_state5 : signal is "none"; signal acc_reg_89 : STD_LOGIC_VECTOR (31 downto 0); signal i_phi_fu_106_p4 : STD_LOGIC_VECTOR (4 downto 0); signal i_reg_102 : STD_LOGIC_VECTOR (4 downto 0); signal data1_reg_114 : STD_LOGIC_VECTOR (31 downto 0); signal tmp_3_fu_148_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_4_fu_153_p1 : STD_LOGIC_VECTOR (63 downto 0); signal tmp_5_fu_157_p1 : STD_LOGIC_VECTOR (63 downto 0); signal grp_fu_123_p0 : STD_LOGIC_VECTOR (4 downto 0); signal tmp_6_fu_161_p0 : STD_LOGIC_VECTOR (31 downto 0); signal ap_NS_fsm : STD_LOGIC_VECTOR (4 downto 0); component fir_shift_reg IS generic ( DataWidth : INTEGER; AddressRange : INTEGER; AddressWidth : INTEGER ); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; address0 : IN STD_LOGIC_VECTOR (3 downto 0); ce0 : IN STD_LOGIC; we0 : IN STD_LOGIC; d0 : IN STD_LOGIC_VECTOR (31 downto 0); q0 : OUT STD_LOGIC_VECTOR (31 downto 0) ); end component; begin shift_reg_U : component fir_shift_reg generic map ( DataWidth => 32, AddressRange => 11, AddressWidth => 4) port map ( clk => ap_clk, reset => ap_rst, address0 => shift_reg_address0, ce0 => shift_reg_ce0, we0 => shift_reg_we0, d0 => shift_reg_d0, q0 => shift_reg_q0); ap_CS_fsm_assign_proc : process(ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (ap_rst = '1') then ap_CS_fsm <= ap_ST_fsm_state1; else ap_CS_fsm <= ap_NS_fsm; end if; end if; end process; acc_reg_89_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then acc_reg_89 <= acc_1_fu_167_p2; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then acc_reg_89 <= ap_const_lv32_0; end if; end if; end process; data1_reg_114_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0))) then data1_reg_114 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then data1_reg_114 <= x; end if; end if; end process; i_reg_102_assign_proc : process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state5)) then i_reg_102 <= i_1_reg_206; elsif (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then i_reg_102 <= ap_const_lv5_A; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state3)) then i_1_reg_206 <= grp_fu_123_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state2)) then i_cast_reg_178 <= i_cast_fu_130_p1; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0))) then tmp_1_reg_187 <= tmp_1_fu_142_p2; end if; end if; end process; process (ap_clk) begin if (ap_clk'event and ap_clk = '1') then if ((ap_const_logic_1 = ap_CS_fsm_state4)) then tmp_6_reg_211 <= tmp_6_fu_161_p2; end if; end if; end process; ap_NS_fsm_assign_proc : process (ap_start, ap_CS_fsm, ap_CS_fsm_state1, ap_CS_fsm_state2, tmp_fu_134_p3) begin case ap_CS_fsm is when ap_ST_fsm_state1 => if (((ap_const_logic_1 = ap_CS_fsm_state1) and (ap_start = ap_const_logic_1))) then ap_NS_fsm <= ap_ST_fsm_state2; else ap_NS_fsm <= ap_ST_fsm_state1; end if; when ap_ST_fsm_state2 => if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_NS_fsm <= ap_ST_fsm_state1; else ap_NS_fsm <= ap_ST_fsm_state3; end if; when ap_ST_fsm_state3 => ap_NS_fsm <= ap_ST_fsm_state4; when ap_ST_fsm_state4 => ap_NS_fsm <= ap_ST_fsm_state5; when ap_ST_fsm_state5 => ap_NS_fsm <= ap_ST_fsm_state2; when others => ap_NS_fsm <= "XXXXX"; end case; end process; acc_1_fu_167_p2 <= std_logic_vector(unsigned(tmp_6_reg_211) + unsigned(acc_reg_89)); ap_CS_fsm_state1 <= ap_CS_fsm(0); ap_CS_fsm_state2 <= ap_CS_fsm(1); ap_CS_fsm_state3 <= ap_CS_fsm(2); ap_CS_fsm_state4 <= ap_CS_fsm(3); ap_CS_fsm_state5 <= ap_CS_fsm(4); ap_done_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_done <= ap_const_logic_1; else ap_done <= ap_const_logic_0; end if; end process; ap_idle_assign_proc : process(ap_start, ap_CS_fsm_state1) begin if (((ap_const_logic_0 = ap_start) and (ap_const_logic_1 = ap_CS_fsm_state1))) then ap_idle <= ap_const_logic_1; else ap_idle <= ap_const_logic_0; end if; end process; ap_ready_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then ap_ready <= ap_const_logic_1; else ap_ready <= ap_const_logic_0; end if; end process; c_address0 <= tmp_5_fu_157_p1(4 - 1 downto 0); c_ce0_assign_proc : process(ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then c_ce0 <= ap_const_logic_1; else c_ce0 <= ap_const_logic_0; end if; end process; grp_fu_123_p0_assign_proc : process(ap_CS_fsm_state2, ap_CS_fsm_state3, i_phi_fu_106_p4, i_reg_102) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then grp_fu_123_p0 <= i_reg_102; elsif ((ap_const_logic_1 = ap_CS_fsm_state2)) then grp_fu_123_p0 <= i_phi_fu_106_p4; else grp_fu_123_p0 <= "XXXXX"; end if; end process; grp_fu_123_p2 <= std_logic_vector(unsigned(grp_fu_123_p0) + unsigned(ap_const_lv5_1F)); i_cast_fu_130_p1 <= std_logic_vector(IEEE.numeric_std.resize(signed(i_reg_102),32)); i_phi_fu_106_p4 <= i_reg_102; shift_reg_address0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3, tmp_3_fu_148_p1, tmp_4_fu_153_p1) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_address0 <= tmp_4_fu_153_p1(4 - 1 downto 0); elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_address0 <= ap_const_lv4_0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0))) then shift_reg_address0 <= tmp_3_fu_148_p1(4 - 1 downto 0); else shift_reg_address0 <= "XXXX"; end if; end process; shift_reg_ce0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_0)) or (ap_const_logic_1 = ap_CS_fsm_state3) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_ce0 <= ap_const_logic_1; else shift_reg_ce0 <= ap_const_logic_0; end if; end process; shift_reg_d0_assign_proc : process(x, shift_reg_q0, ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((ap_const_logic_1 = ap_CS_fsm_state3)) then shift_reg_d0 <= shift_reg_q0; elsif (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1))) then shift_reg_d0 <= x; else shift_reg_d0 <= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; end if; end process; shift_reg_we0_assign_proc : process(ap_CS_fsm_state2, tmp_1_fu_142_p2, tmp_1_reg_187, tmp_fu_134_p3, ap_CS_fsm_state3) begin if ((((ap_const_logic_1 = ap_CS_fsm_state3) and (tmp_1_reg_187 = ap_const_lv1_0)) or ((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_0) and (tmp_1_fu_142_p2 = ap_const_lv1_1)))) then shift_reg_we0 <= ap_const_logic_1; else shift_reg_we0 <= ap_const_logic_0; end if; end process; tmp_1_fu_142_p2 <= "1" when (i_reg_102 = ap_const_lv5_0) else "0"; tmp_3_fu_148_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(grp_fu_123_p2),64)); tmp_4_fu_153_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_5_fu_157_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(i_cast_reg_178),64)); tmp_6_fu_161_p0 <= c_q0; tmp_6_fu_161_p2 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(std_logic_vector(signed(tmp_6_fu_161_p0) * signed(data1_reg_114))), 32)); tmp_fu_134_p3 <= i_reg_102(4 downto 4); y <= acc_reg_89; y_ap_vld_assign_proc : process(ap_CS_fsm_state2, tmp_fu_134_p3) begin if (((ap_const_logic_1 = ap_CS_fsm_state2) and (tmp_fu_134_p3 = ap_const_lv1_1))) then y_ap_vld <= ap_const_logic_1; else y_ap_vld <= ap_const_logic_0; end if; end process; end behav;