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

Subversion Repositories yac

[/] [yac/] [trunk/] [c_octave/] [cordic_iterative_setup.m] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 feddischso
 
2
%
3
% flags: they are also define in cordic_iterative.c and
4
%        cordic_iterative_pkg.vhd
5
C_FLAG_VEC_ROT  = 2^3;
6
C_FLAG_ATAN_3   = 2^2;
7
C_MODE_CIRC     = 0;
8
C_MODE_LIN      = 1;
9
C_MODE_HYP      = 2;
10
 
11
% initialize the random-generator's seed
12
rand('seed', 1633);
13
 
14
 
15
% cordic setup:
16
% this must fit to the testbench
17
XY_WIDTH   = 8;
18
ANGLEWIDTH = 8;
19
GUARDBITS  = 2;
20
RM_GAIN    = 3;
21
 
22
TB_FILE    = './tb_data.txt'
23
% open test file
24
%tb_fid = 0;
25
 
26
 
27
function write_tb( fid, x_i, y_i, a_i, x_o, y_o, a_o, mode )
28
 
29
if fid > 0
30
    for x = 1 : length( x_i )
31
        fprintf( fid, '%ld ', fix( [ x_i(x), y_i(x), a_i(x), x_o(x), y_o(x), a_o(x), mode ] ) );
32
        fprintf( fid, '\n' );
33
    end
34
end
35
 
36
end
37
 

powered by: WebSVN 2.1.0

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