OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [VHDL/] [o8_vdsm8.vhd] - Diff between revs 217 and 221

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 217 Rev 221
Line 22... Line 22...
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
--
-- VHDL Units :  o8_vdsm8
-- VHDL Units :  o8_vdsm8
-- Description:  8-bit variable delta-sigma modulator.
-- Description:  8-bit variable delta-sigma modulator.
--
--
 
-- Register Map:
 
-- Offset  Bitfield Description                        Read/Write
 
--   0x00  AAAAAAAA DAC Value                             (RW)
 
--
-- Revision History
-- Revision History
-- Author          Date     Change
-- Author          Date     Change
------------------ -------- ---------------------------------------------------
------------------ -------- ---------------------------------------------------
-- Seth Henry      06/23/16 Design start
-- Seth Henry      06/23/16 Design start
-- Seth Henry      04/10/20 Code Cleanup
-- Seth Henry      04/10/20 Code Cleanup
Line 38... Line 42...
library work;
library work;
  use work.open8_pkg.all;
  use work.open8_pkg.all;
 
 
entity o8_vdsm8 is
entity o8_vdsm8 is
generic(
generic(
 
  Default_Value              : DATA_TYPE := x"00";
  Reset_Level                : std_logic;
  Reset_Level                : std_logic;
  Address                    : ADDRESS_TYPE
  Address                    : ADDRESS_TYPE
);
);
port(
port(
  Clock                      : in  std_logic;
  Clock                      : in  std_logic;
Line 57... Line 62...
);
);
end entity;
end entity;
 
 
architecture behave of o8_vdsm8 is
architecture behave of o8_vdsm8 is
 
 
  constant User_Addr         : std_logic_vector(15 downto 0) := Address;
  constant User_Addr         : std_logic_vector(15 downto 0)
 
                               := Address(15 downto 0);
  alias  Comp_Addr           is Bus_Address(15 downto 0);
  alias  Comp_Addr           is Bus_Address(15 downto 0);
  signal Addr_Match          : std_logic := '0';
  signal Addr_Match          : std_logic;
  signal Wr_En               : std_logic := '0';
  signal Wr_En               : std_logic;
  signal Wr_Data_q           : DATA_TYPE := x"00";
  signal Wr_Data_q           : DATA_TYPE;
  signal Rd_En               : std_logic := '0';
  signal Reg_Out             : DATA_TYPE;
  signal DACin               : DATA_TYPE := x"00";
  signal Rd_En               : std_logic;
 
 
 
 
begin
begin
 
 
  Addr_Match                 <= '1' when Comp_Addr = User_Addr else '0';
  Addr_Match                 <= '1' when Comp_Addr = User_Addr else '0';
 
 
  io_reg: process( Clock, Reset )
  io_reg: process( Clock, Reset )
  begin
  begin
    if( Reset = Reset_Level )then
    if( Reset = Reset_Level )then
      Wr_En                  <= '0';
      Wr_En                  <= '0';
      Wr_Data_q              <= x"00";
      Wr_Data_q              <= x"00";
 
      Reg_Out                <= Default_Value;
      Rd_En                  <= '0';
      Rd_En                  <= '0';
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
      DACin                  <= x"00";
 
    elsif( rising_edge( Clock ) )then
    elsif( rising_edge( Clock ) )then
      Wr_En                  <= Addr_Match and Wr_Enable;
      Wr_En                  <= Addr_Match and Wr_Enable;
      Wr_Data_q              <= Wr_Data;
      Wr_Data_q              <= Wr_Data;
      if( Wr_En = '1' )then
      if( Wr_En = '1' )then
        DACin                <= Wr_Data_q;
        Reg_Out              <= Wr_Data_q;
      end if;
      end if;
 
 
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_En                  <= Addr_Match and Rd_Enable;
      Rd_En                  <= Addr_Match and Rd_Enable;
      if( Rd_En = '1' )then
      if( Rd_En = '1' )then
        Rd_Data              <= DACin;
        Rd_Data              <= Reg_Out;
      end if;
      end if;
    end if;
    end if;
  end process;
  end process;
 
 
  U_DAC : entity work.vdsm8
  U_DAC : entity work.vdsm8
Line 100... Line 105...
    Reset_Level              => Reset_Level
    Reset_Level              => Reset_Level
  )
  )
  port map(
  port map(
    Clock                    => Clock,
    Clock                    => Clock,
    Reset                    => Reset,
    Reset                    => Reset,
    DACin                    => DACin,
    DACin                    => Reg_Out,
    DACout                   => DACout
    DACout                   => DACout
  );
  );
 
 
end architecture;
end architecture;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.