[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7174 - usrp2/trunk/fpga/models
From: |
matt |
Subject: |
[Commit-gnuradio] r7174 - usrp2/trunk/fpga/models |
Date: |
Fri, 14 Dec 2007 01:56:50 -0700 (MST) |
Author: matt
Date: 2007-12-14 01:56:50 -0700 (Fri, 14 Dec 2007)
New Revision: 7174
Modified:
usrp2/trunk/fpga/models/adc_model.v
usrp2/trunk/fpga/models/math_real.v
Log:
speedups
Modified: usrp2/trunk/fpga/models/adc_model.v
===================================================================
--- usrp2/trunk/fpga/models/adc_model.v 2007-12-14 08:24:26 UTC (rev 7173)
+++ usrp2/trunk/fpga/models/adc_model.v 2007-12-14 08:56:50 UTC (rev 7174)
@@ -21,19 +21,17 @@
assign adc_b = adc_oe_b ? adc_b_int : 14'bz;
assign adc_ovf_b = adc_oe_b ? 1'b0 : 1'bz;
- real phase = 0;
+ real phase = 0;
+ real sample_rate = 100000000;
+ real freq = 330000/sample_rate; // 330 kHz
- real my_e = math.MATH_E;
-
- real sample_rate = 100000000;
- real freq = 330000/sample_rate; // 330 kHz
-
+ real scale = math.pow(2,13)-2;
always @(posedge clk)
begin
if(adc_on_a)
- adc_a_int <=
$rtoi(math.round(math.sin(phase*math.MATH_2_PI)*(math.pow(2,13)-1))) ;
+ adc_a_int <= $rtoi(math.round(math.sin(phase*math.MATH_2_PI)*scale)) ;
if(adc_on_b)
- adc_b_int <=
$rtoi(math.round(math.cos(phase*math.MATH_2_PI)*(math.pow(2,13)-1))) ;
+ adc_b_int <= $rtoi(math.round(math.cos(phase*math.MATH_2_PI)*scale)) ;
if(phase > 1)
phase <= phase + freq - 1;
else
Modified: usrp2/trunk/fpga/models/math_real.v
===================================================================
--- usrp2/trunk/fpga/models/math_real.v 2007-12-14 08:24:26 UTC (rev 7173)
+++ usrp2/trunk/fpga/models/math_real.v 2007-12-14 08:56:50 UTC (rev 7174)
@@ -26,7 +26,7 @@
// The number of iterations to do for the Taylor series approximations
localparam EXPLOG_ITERATIONS = 19;
- localparam COS_ITERATIONS = 13;
+ localparam COS_ITERATIONS = 8;
/* Conversion Routines */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7174 - usrp2/trunk/fpga/models,
matt <=