Tdm to vo ip 2

267 views
188 views

Published on

This gives the programming details of the TDM to VoIP conversion using FPGA

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
267
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Tdm to vo ip 2

  1. 1. Guided byDr. Sunil Kumar. S. ManviProject MembersAbhiroop. M. NAsha. A. RNagapooja. KPavan. S
  2. 2. component codecclkPORT(inclk0 : IN STD_LOGIC ;c0 : OUT STD_LOGIC);end component;Codec clkIn clk(25 Mhz)C0(2.048 Mhz)
  3. 3. component pll75mPORT(inclk0 : IN STD_LOGIC ;c0 : OUT STD_LOGIC);end component;PLL 75MhzIn clk(2.048 Mhz)C0(75 Mhz)
  4. 4. component packetmemPORT(data : IN STD_LOGIC_VECTOR (7 DOWNTO 0);inclock : IN STD_LOGIC := 1;outclock : IN STD_LOGIC ;rdaddress : IN STD_LOGIC_VECTOR (12 DOWNTO 0);wraddress : IN STD_LOGIC_VECTOR (12 DOWNTO 0);wren : IN STD_LOGIC := 0;q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0));end component;PLL 75MhzdataIn clockOut clockWR AddressRD AddressWR EnableQ
  5. 5. codecclk_inst : codecclkPORT MAP(inclk0 => clkin,c0 => clk2048m);pll75m_inst : pll75mPORT MAP(inclk0 => clkin,c0 => clk75m);
  6. 6. packetmem_init : packetmemPORT MAP(data => rxmemip,inclock => clk2048m,outclock => clk75m,rdaddress => (bytecnt(3 downto 0) +1) & (not bank) & rxmemwa,wraddress => bytecnt(3 downto 0) & bank & rxmemwa,wren => rxmemwe,q => rdatareg_1);bytecnt bank rxmemwa
  7. 7. rdata <= CODEC_VOUT1 when (bytecnt =1 or bytecnt =2 or bytecnt =3 or bytecnt =4)else CODEC_VOUT2 when (bytecnt =5 or bytecnt =6 or bytecnt =7 or bytecnt =8)else CODEC_VOUT3 when (bytecnt =9 or bytecnt =10 or bytecnt =11 or bytecnt =12)else CODEC_VOUT4 when (bytecnt =13 or bytecnt =14 or bytecnt =15 or bytecnt =16) ;SYNC_D(1) <= 1 when (bytecnt =0 and bitcnt =7)else 0;SYNC_D(2) <= 1 when (bytecnt =1 and bitcnt =7)else 0;SYNC_D(3) <= 1 when (bytecnt =2 and bitcnt =7) else 0;SYNC_D(4) <= 1 when (bytecnt =3 and bitcnt =7) else 0;SYNC_D(5) <= 1 when (bytecnt =4 and bitcnt =7) else 0;SYNC_D(6) <= 1 when (bytecnt =5 and bitcnt =7) else 0;SYNC_D(7) <= 1 when (bytecnt =6 and bitcnt =7) else 0;SYNC_D(8) <= 1 when (bytecnt =7 and bitcnt =7) else 0;
  8. 8. 1 bit1byte 160 bytes 1byte1 bitCodec_Vout0rdatatdataregrdataregCodec_Vin2160 bytesBank 0 Bank 1
  9. 9. rx_sm1:process (clk2048m)beginif ( clk2048m event and clk2048m = 0) thenrdata1 <= rdata;end if;end process;rx_sm:process (clk2048m)beginif ( clk2048m event and clk2048m=1) thenif( int_reset = 1) thenbitcnt <= (others=>0);bytecnt <= (others=>0);framecnt <= (others=>0);end if;if( framecnt = "10100000") thenframecnt <= "00000000";bank <= not bank;end if;
  10. 10. if( bitcnt = 1) thenrxmemip <= rdatareg ;rxmemwa <= framecnt;rxmemwab <= bank;rxmemwe <= 1;elserxmemwe <= 0;end if;end if;end if;elserdatareg1 <= rdatareg1(6 downto 0) & rdata1;bitcnt <= bitcnt + 1;if( bitcnt = 7) thenif( bytecnt = framelength ) thenbytecnt <= (others=>0);framecnt <= framecnt + 1;elsebytecnt <= bytecnt + 1;end if;end if;if( bitcnt = 0) thenrdatareg <= rdatareg1;end if;
  11. 11. if ( clk2048mevent and clk2048m=1) thenif( bitcnt = 7)thentdatareg0 <= rdatareg_1;elsetdatareg0 <= tdatareg0(6 downto 0)& 0;end if;end if;CODEC_VIN2 <= tdatareg0(7);

×