亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fft.cpp

?? SystemC片上系統設計的源代碼: 書籍介紹: SystemC是被實踐證明的優秀的系統設計描述語言
?? CPP
字號:
/*****************************************************************************

  The following code is derived, directly or indirectly, from the SystemC
  source code Copyright (c) 1996-2002 by all Contributors.
  All Rights reserved.

  The contents of this file are subject to the restrictions and limitations
  set forth in the SystemC Open Source License Version 2.3 (the "License");
  You may not use this file except in compliance with such restrictions and
  limitations. You may obtain instructions on how to receive a copy of the
  License at http://www.systemc.org/. Software distributed by Contributors
  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
  ANY KIND, either express or implied. See the License for the specific
  language governing rights and limitations under the License.

 *****************************************************************************/

/*****************************************************************************

  fft.cpp - This is the implementation file for the synchronous process "fft".

  Original Author: Rashmi Goswami, Synopsys, Inc.

 *****************************************************************************/

/*****************************************************************************

  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
  changes you are making here.

      Name, Affiliation, Date:
  Description of Modification:

 *****************************************************************************/


/* This is the implementation file for the synchronous process "fft" */
#include "systemc.h"
#include "fft.h"


//Function for butterfly computation

 void func_butterfly
    ( const fx_db& w_real   /* snps width 16 */,
      const fx_db& w_imag   /* snps width 16 */, 
      const fx_db& real1_in /* snps width 16 */,
      const fx_db& imag1_in /* snps width 16 */,
      const fx_db& real2_in /* snps width 16 */,
      const fx_db& imag2_in /* snps width 16 */,
      fx_db& real1_out /* snps width 16 */,
      fx_db& imag1_out /* snps width 16 */,
      fx_db& real2_out /* snps width 16 */,
      fx_db& imag2_out /* snps width 16 */
    )
 {

   // Variable declarations
	 #ifndef DOUBLE_FFT
     sc_int<17> tmp_real1;
     sc_int<17> tmp_imag1;
     sc_int<17> tmp_real2;
     sc_int<17> tmp_imag2;
     sc_int<34> tmp_real3;
     sc_int<34> tmp_imag3;
     #else
     fx_db tmp_real1;
     fx_db tmp_imag1;
     fx_db tmp_real2;
     fx_db tmp_imag2;
     fx_db tmp_real3;
     fx_db tmp_imag3;
     #endif
    // Begin Computation

    tmp_real1 = real1_in + real2_in; 

    // <s,6,10> = <s,5,10> + <s,5,10>
    tmp_imag1 = imag1_in + imag2_in;

    // <s,6,10> = <s,5,10> - <s,5,10>
    tmp_real2 = real1_in - real2_in;

    // <s,6,10> = <s,5,10> - <s,5,10>
    tmp_imag2 = imag1_in - imag2_in;

    //   <s,13,20> = <s,6,10>*<s,5,10> - <s,6,10>*<s,5,10>
    tmp_real3 = tmp_real2*w_real - tmp_imag2*w_imag;

    //   <s,13,20> = <s,6,10>*<s,5,10> - <s,6,10>*<s,5,10>
    tmp_imag3 = tmp_real2*w_imag + tmp_imag2*w_real; 

    // assign the sign-bit(MSB)      
#ifndef DOUBLE_FFT
    real1_out[15] = tmp_real1[16];
    imag1_out[15] = tmp_imag1[16];

    // assign the rest of the bits
    real1_out.range(14,0) = tmp_real1.range(14,0);
    imag1_out.range(14,0) = tmp_imag1.range(14,0);

   // assign the sign-bit(MSB)      
    real2_out[15] = tmp_real3[33];
    imag2_out[15] = tmp_imag3[33];          

   // assign the rest of the bits
    real2_out.range(14,0) = tmp_real3.range(24,10);
    imag2_out.range(14,0) = tmp_imag3.range(24,10);
#else
	real1_out=tmp_real1;
	imag1_out=tmp_imag1;
	real2_out=tmp_real3;
    imag2_out=tmp_imag3;
#endif
 }; // end func_butterfly

void fft::entry()
{ 
 // Variable Declarations
  fx_db real[16];
  fx_db imag[16];
  fx_db tmp_real;
  fx_db tmp_imag;
  short index;
  sc_int<6> N;  
  sc_int<4> M;
  sc_int<6> len;
  fx_db W_real[7];
  fx_db W_imag[7];
  fx_db w_real;
  fx_db w_imag;
  fx_db w_rec_real;
  fx_db w_rec_imag;
#ifndef DOUBLE_FFT
  sc_int<32> w_temp1;
  sc_int<32> w_temp2;
  sc_int<32> w_temp3;
  sc_int<32> w_temp4;
  sc_int<33> w_temp5;
  sc_int<33> w_temp6;
#else
  fx_db w_temp1;
  fx_db w_temp2;
  fx_db w_temp3;
  fx_db w_temp4;
  fx_db w_temp5;
  fx_db w_temp6;
#endif
  fx_db real1_in;
  fx_db imag1_in;
  fx_db real2_in;
  fx_db imag2_in;
  fx_db real1_out;
  fx_db imag1_out;
  fx_db real2_out;
  fx_db imag2_out;
  sc_int<4> stage;
  short i;
  short j;
  short index2;
  short windex;
  short incr;

  while(true)
  { data_req.write(false);
    data_ready.write(false);
    index = 0; 
     
    wait();
    //Read in the Sample values
      cout << endl << "Reading in the samples..." << endl;
      while( index < 16 )
      {
       data_req.write(true);	   
       wait_until(data_valid.delayed() == true);
	   cout << endl << "data_req_write" << endl;
       tmp_real = in_real.read();
       tmp_imag = in_imag.read();
       real[index] = tmp_real;
       imag[index] = tmp_imag;
       index++;
       data_req.write(false);
       wait();
      }
      index = 0;

 
       // Initialize
       M = 4; N = 16; 
       len = N >> 1;

       cout << "Computing..." << endl;
       // Calculate the W-values recursively
       // <'s'/'u',m,n>: is used in comments to denote a fixed point representation
       // 's'- signed, 'u'- unsigned, m - no. of integer bits, n - no. of fractional bits

       //  theta = 8.0*atan(1.0)/N; theta = 22.5 degree

       //  w_real =  cos(theta) = 0.92 (000000.1110101110) <s,5,10>
           w_real =  942;

       //  w_imag = -sin(theta) = -0.38(111111.1001111010) <s,5,10>
           w_imag = -389;

       //  w_rec_real = 1(0000001.0000000000)
	   w_rec_real = 1024;

       //  w_rec_real = 0(000000.0000000000)	 
           w_rec_imag = 0;

        unsigned short w_index;

        w_index = 0;    
        while(w_index < 7) 
        {
	  // <s,11,20> = <s,5,10> * <s,5,10>
	   w_temp1 = w_rec_real*w_real;
	   w_temp2 = w_rec_imag*w_imag;

          // <s,11,20> = <s,5,10> * <s,5,10>
	   w_temp3 = w_rec_real*w_imag;
	   w_temp4 = w_rec_imag*w_real;	 

	  // <s,6,10> = <s,5,10> - <s,5,10>
           w_temp5 = w_temp1 - w_temp2;

	  // <s,6,10> = <s,5,10> + <s,5,10>
	   w_temp6 = w_temp3 + w_temp4;
#ifndef DOUBLE_FFT 
	  // assign the sign-bit(MSB)
           W_real[w_index][15] = w_temp5[32];
           W_imag[w_index][15] = w_temp6[32];

	  // assign the rest of the bits
           W_real[w_index].range(14,0) = w_temp5.range(24,10);
           W_imag[w_index].range(14,0) = w_temp6.range(24,10);

	  
#else
	       W_real[w_index] = w_temp5;
           W_imag[w_index] = w_temp6;
#endif
		  // update w_rec.. values for the next iteration
	   w_rec_real = W_real[w_index];
	   w_rec_imag = W_imag[w_index];
	   w_index++;

        }

      //////////////////////////////////////////////////////////////////////////
      ///  Computation - 1D Complex DFT In-Place DIF Computation Algorithm  ////
      //////////////////////////////////////////////////////////////////////////

       stage = 0;
       len = N;
       incr = 1;

       while (stage < M) 
       { 
	 len = len >> 1;
 
        //First Iteration :  Simple calculation, with no multiplies
          i = 0;
          while(i < N)
          {
             index =  i; index2 = i + len; 

             tmp_real = real[index] + real[index2];
             tmp_imag = imag[index] + imag[index2];

             real[index2] = (real[index] - real[index2]);
             imag[index2] = (imag[index] - imag[index2]);

             real[index] = tmp_real;
             imag[index] = tmp_imag;
	    
	     i = i + (len << 1);   
          }

        //Remaining Iterations: Use Stored W
         j = 1; windex = incr - 1;
        // This loop executes N/2 times at the first stage, N/2 times at the second.. once at last stage
         while (j < len)
         {
            i = j; 
            while (i < N)
            {
              index = i;
              index2 = i + len;

	      // Read in the data and twiddle factors
	      w_real  = W_real[windex];
	      w_imag  = W_imag[windex];

              real1_in = real[index];
	      imag1_in = imag[index];
              real2_in = real[index2];
	      imag2_in = imag[index2];

              // Call butterfly computation function	     
	      func_butterfly(w_real, w_imag, real1_in, imag1_in, real2_in, imag2_in, real1_out, imag1_out, real2_out, imag2_out);

	      // Store back the results
              real[index]  = real1_out;
              imag[index]  = imag1_out; 
              real[index2] = real2_out;
              imag[index2] = imag2_out; 

              i = i + (len << 1);
            }
            windex = windex + incr;
            j++;
         }
          stage++;
          incr = incr << 1;
       } 
           
     //////////////////////////////////////////////////////////////////////////   
     //Writing out the normalized transform values in bit reversed order
     //////////////////////////////////////////////////////////////////////////

      sc_uint<4> bits_i;
      sc_uint<4> bits_index;
      fx_db real1;
      fx_db imag1;
      bits_i = 0;
      bits_index = 0;
      i = 0;

      cout << "Writing the transform values..." << endl;
      while( i < 16)
      {
       bits_i = i;
       bits_index[3]= bits_i[0];
       bits_index[2]= bits_i[1];
       bits_index[1]= bits_i[2];
       bits_index[0]= bits_i[3];
       index = bits_index;
       real1 = real[index];
       imag1 = imag[index];
       out_real.write(real1); 
       out_imag.write(imag1); 
       data_ready.write(true);
       wait_until(data_ack.delayed() == true);
       data_ready.write(false);
       i++;
       wait();
      }
      index = 0; 
      cout << "Done..." << endl;
  }      
}// end entry() function

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频一二| 亚洲午夜影视影院在线观看| 综合久久久久久| 蓝色福利精品导航| 欧美亚洲愉拍一区二区| 久久免费美女视频| 蜜桃在线一区二区三区| 在线观看亚洲精品视频| 亚洲国产精品传媒在线观看| 日本美女视频一区二区| 欧美日韩在线三级| ...xxx性欧美| 不卡一区二区三区四区| 精品久久国产97色综合| 舔着乳尖日韩一区| 欧美日免费三级在线| 亚洲精品欧美在线| 色综合天天综合色综合av| 久久久久久久久久久99999| 秋霞电影一区二区| 日韩三级电影网址| 污片在线观看一区二区| 欧美日韩视频第一区| 亚洲午夜电影网| 在线日韩国产精品| 亚洲欧美一区二区久久 | 喷水一区二区三区| 欧美精品免费视频| 午夜电影一区二区三区| 欧美色图天堂网| 亚洲一区二区三区免费视频| 在线中文字幕一区二区| 亚洲成人www| 91麻豆精品国产自产在线| 天天av天天翘天天综合网色鬼国产| 色婷婷综合久久久久中文一区二区 | 国模一区二区三区白浆| 日韩欧美电影一二三| 奇米精品一区二区三区四区| 欧美一卡2卡三卡4卡5免费| 日本不卡123| 日韩免费观看高清完整版在线观看| 日韩成人伦理电影在线观看| 91精品国产综合久久久久久久久久| 日日夜夜免费精品| 日韩欧美色综合| 国产精品一区二区在线播放| 欧美精彩视频一区二区三区| kk眼镜猥琐国模调教系列一区二区| 中文字幕国产一区| 日本道在线观看一区二区| 亚洲午夜久久久| 日韩精品中文字幕一区| 国产精品一区二区在线播放| 国产精品的网站| 欧美乱熟臀69xxxxxx| 极品少妇一区二区| 国产精品久久久久一区| 在线视频一区二区免费| 美女诱惑一区二区| 国产精品国产a级| 欧美日韩一区二区三区免费看| 久久不见久久见中文字幕免费| 国产精品久久久久久久久动漫| 欧美在线观看禁18| 国产精品一区在线观看乱码| 亚洲激情图片小说视频| 2021国产精品久久精品| 欧美最猛黑人xxxxx猛交| 九九视频精品免费| 亚洲影院在线观看| 久久精品夜色噜噜亚洲aⅴ| 欧美三区在线观看| 国产成人在线视频网址| 亚洲a一区二区| 亚洲国产精品av| 欧美成人a视频| 欧美三级日韩在线| 99久久精品99国产精品 | 久久理论电影网| 欧美在线免费播放| 国产白丝精品91爽爽久久| 无码av免费一区二区三区试看 | 日日摸夜夜添夜夜添精品视频| www国产成人免费观看视频 深夜成人网 | 欧美人狂配大交3d怪物一区| 国产999精品久久久久久| 丝袜国产日韩另类美女| 亚洲免费资源在线播放| 国产亚洲一区二区三区四区| 日韩三级高清在线| 欧美精品久久久久久久多人混战| 菠萝蜜视频在线观看一区| 经典三级视频一区| 日本午夜一本久久久综合| 亚洲国产视频直播| 亚洲毛片av在线| 中文子幕无线码一区tr| 精品奇米国产一区二区三区| 69成人精品免费视频| 欧美在线观看视频在线| 欧洲精品在线观看| 91香蕉国产在线观看软件| www.爱久久.com| 成人伦理片在线| 成人激情视频网站| 丁香一区二区三区| 成人av动漫在线| 成人午夜电影小说| 成人午夜私人影院| 99国产精品久久久久久久久久| 国产精品18久久久久久久久久久久 | 自拍偷拍国产亚洲| 日韩伦理av电影| 日韩美女视频一区二区| 亚洲同性同志一二三专区| 一区二区中文视频| 一区二区三区在线免费| 一区二区三区在线不卡| 夜夜嗨av一区二区三区 | 亚洲色图欧美激情| 亚洲黄一区二区三区| 一区二区不卡在线播放 | 亚洲一区二区三区四区在线观看| 亚洲欧美偷拍另类a∨色屁股| 亚洲欧洲精品一区二区三区| 亚洲乱码精品一二三四区日韩在线| 亚洲视频在线观看三级| 亚洲一区二区三区四区中文字幕| 午夜欧美2019年伦理| 久久9热精品视频| 成人免费看片app下载| 91视频你懂的| 777亚洲妇女| 久久亚洲精精品中文字幕早川悠里| 久久久国产一区二区三区四区小说| 国产香蕉久久精品综合网| 亚洲欧美日韩综合aⅴ视频| 午夜激情久久久| 国产精品一区二区x88av| 91网站最新地址| 欧美一区二区三区视频在线 | 石原莉奈一区二区三区在线观看 | 91黄色激情网站| 日韩欧美激情一区| 国产精品久久久久久久岛一牛影视| 自拍av一区二区三区| 日韩成人午夜电影| a亚洲天堂av| 欧美精品久久天天躁| 中文字幕高清一区| 亚洲国产精品一区二区久久恐怖片 | 日韩精品专区在线| 亚洲欧洲在线观看av| 日本亚洲视频在线| 99久久精品免费精品国产| 欧美高清dvd| 成人免费在线视频观看| 久久电影网站中文字幕| 在线观看亚洲一区| 欧美激情在线一区二区三区| 亚洲成人三级小说| 成年人国产精品| 精品国产一区二区三区不卡| 一区二区三国产精华液| 国产91精品久久久久久久网曝门 | 日韩专区欧美专区| 99九九99九九九视频精品| 欧美一区二区久久久| 成人免费小视频| 国产精品99久久久久久宅男| 欧美顶级少妇做爰| 一区二区不卡在线视频 午夜欧美不卡在| 麻豆精品一区二区| 宅男在线国产精品| 亚洲精品视频在线看| 国产不卡视频一区| 亚洲精品一区二区三区四区高清 | 日日摸夜夜添夜夜添国产精品| aaa亚洲精品一二三区| 久久色.com| 久久国产乱子精品免费女| 欧美日韩日日摸| 亚洲午夜一区二区三区| 日本黄色一区二区| 亚洲裸体xxx| 91啦中文在线观看| 日韩一区在线看| 97se亚洲国产综合在线| 国产精品美女久久久久久久久久久| 韩国av一区二区| 精品毛片乱码1区2区3区| 日韩福利视频导航| 欧美一级日韩一级| 日韩和的一区二区| 91精品国产全国免费观看| 亚洲国产美女搞黄色| 欧美日韩午夜在线| 美女尤物国产一区| 精品国产网站在线观看|