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

Subversion Repositories spdif_interface

[/] [spdif_interface/] [trunk/] [bench/] [vhdl/] [spdif_source.vhd] - Diff between revs 4 and 13

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

Rev 4 Rev 13
Line 43... Line 43...
----------------------------------------------------------------------
----------------------------------------------------------------------
--
--
-- CVS Revision History
-- CVS Revision History
--
--
-- $Log: not supported by cvs2svn $
-- $Log: not supported by cvs2svn $
 
-- Revision 1.1  2004/06/03 17:45:18  gedra
 
-- SPDIF signal generator.
 
--
--
--
 
 
LIBRARY ieee;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_1164.ALL;
 
 
entity spdif_source is
entity spdif_source is
  generic (Freq: natural);            -- Sampling frequency in Hz
  generic (FREQ: natural);            -- Sampling frequency in Hz
  port (                              -- Bitrate is 64x sampling frequency
  port (                              -- Bitrate is 64x sampling frequency
    reset: in std_logic;
    reset: in std_logic;
    spdif: out std_logic);            -- Output bi-phase encoded signal
    spdif: out std_logic);            -- Output bi-phase encoded signal
end spdif_source;
end spdif_source;
 
 
Line 86... Line 89...
 
 
-- Generate SPDIF signal 
-- Generate SPDIF signal 
  SGEN: process (clk, reset)
  SGEN: process (clk, reset)
  begin
  begin
    if reset = '1' then
    if reset = '1' then
      fcnt <= 189;                        -- start just before block to shorten simulation
      fcnt <= 188;      -- start just before block to shorten simulation
      bcnt <= 0;
      bcnt <= 0;
      toggle <= 0;
      toggle <= 0;
      ispdif <= '0';
      ispdif <= '0';
    elsif rising_edge(clk) then
    elsif rising_edge(clk) then
      if toggle = 1 then
      if toggle = 1 then
Line 195... Line 198...
    end if;
    end if;
  end process SGEN;
  end process SGEN;
 
 
-- Clock process, generate a clock based on the desired sampling frequency    
-- Clock process, generate a clock based on the desired sampling frequency    
  CLKG: process
  CLKG: process
    variable t1: time := 1.0e12/real(freq*256) * 1 ps;
    variable t1: time := 1.0e12/real(FREQ*256) * 1 ps;
  begin
  begin
    clk <= '0';
    clk <= '0';
    wait for t1;
    wait for t1;
    clk <= '1';
    clk <= '1';
    wait for t1;
    wait for t1;

powered by: WebSVN 2.1.0

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