#! /c/Source/iverilog-install/bin/vvp
:ivl_version "12.0 (devel)" "(s20150603-1539-g2693dd32b)";
:ivl_delay_selection "TYPICAL";
:vpi_time_precision - 12;
:vpi_module "D:\scoop\apps\iverilog\current\lib\ivl\system.vpi";
:vpi_module "D:\scoop\apps\iverilog\current\lib\ivl\vhdl_sys.vpi";
:vpi_module "D:\scoop\apps\iverilog\current\lib\ivl\vhdl_textio.vpi";
:vpi_module "D:\scoop\apps\iverilog\current\lib\ivl\v2005_math.vpi";
:vpi_module "D:\scoop\apps\iverilog\current\lib\ivl\va_math.vpi";
S_000001ce3f604210 .scope module, "test_cordic_16bit" "test_cordic_16bit" 2 7;
 .timescale -9 -12;
P_000001ce3f620680 .param/l "CLK_PERIOD" 0 2 9, +C4<00000000000000000000000000001010>;
v000001ce3f674970_0 .var "angle", 15 0;
v000001ce3f6743d0_0 .var "clk", 0 0;
v000001ce3f674470_0 .net "cosine", 31 0, v000001ce3f605890_0;  1 drivers
v000001ce3f674290_0 .var/i "cycle_count", 31 0;
v000001ce3f673ed0_0 .net "done", 0 0, v000001ce3f604ee0_0;  1 drivers
v000001ce3f673e30_0 .net "ready", 0 0, v000001ce3f621200_0;  1 drivers
v000001ce3f673f70_0 .var "rst_n", 0 0;
v000001ce3f674a10_0 .net "sine", 31 0, v000001ce3f6043a0_0;  1 drivers
v000001ce3f673cf0_0 .var "start", 0 0;
S_000001ce3f612170 .scope module, "dut" "cordic_trig_16bit_working" 2 20, 3 24 0, S_000001ce3f604210;
 .timescale 0 0;
    .port_info 0 /INPUT 1 "clk";
    .port_info 1 /INPUT 1 "rst_n";
    .port_info 2 /INPUT 1 "start";
    .port_info 3 /INPUT 16 "angle";
    .port_info 4 /OUTPUT 32 "cosine";
    .port_info 5 /OUTPUT 32 "sine";
    .port_info 6 /OUTPUT 1 "done";
    .port_info 7 /OUTPUT 1 "ready";
P_000001ce3f620c40 .param/l "K_SCALE" 0 3 49, C4<01001101101110101>;
v000001ce3f603160_0 .net "angle", 15 0, v000001ce3f674970_0;  1 drivers
v000001ce3f5d6c80 .array "atan_table", 15 0, 15 0;
v000001ce3f608840_0 .net "clk", 0 0, v000001ce3f6743d0_0;  1 drivers
v000001ce3f605890_0 .var "cosine", 31 0;
v000001ce3f604ee0_0 .var "done", 0 0;
v000001ce3f6080c0_0 .var "iteration", 3 0;
v000001ce3f621200_0 .var "ready", 0 0;
v000001ce3f606260_0 .net "rst_n", 0 0, v000001ce3f673f70_0;  1 drivers
v000001ce3f6043a0_0 .var "sine", 31 0;
v000001ce3f612300_0 .net "start", 0 0, v000001ce3f673cf0_0;  1 drivers
v000001ce3f6123a0_0 .var "x", 16 0;
v000001ce3f612440_0 .var "x_next", 16 0;
v000001ce3f6124e0_0 .var "y", 16 0;
v000001ce3f674830_0 .var "y_next", 16 0;
v000001ce3f6748d0_0 .var "z", 15 0;
v000001ce3f674330_0 .var "z_next", 15 0;
E_000001ce3f620e80/0 .event negedge, v000001ce3f606260_0;
E_000001ce3f620e80/1 .event posedge, v000001ce3f608840_0;
E_000001ce3f620e80 .event/or E_000001ce3f620e80/0, E_000001ce3f620e80/1;
E_000001ce3f620800 .event "_ivl_0";
S_000001ce3f674ad0 .scope task, "wait_cycles" "wait_cycles" 2 41, 2 41 0, S_000001ce3f604210;
 .timescale -9 -12;
v000001ce3f6741f0_0 .var/i "num_cycles", 31 0;
E_000001ce3f6208c0 .event posedge, v000001ce3f608840_0;
TD_test_cordic_16bit.wait_cycles ;
    %load/vec4 v000001ce3f6741f0_0;
T_0.0 %dup/vec4;
    %pushi/vec4 0, 0, 32;
    %cmp/s;
    %jmp/1xz T_0.1, 5;
    %jmp/1 T_0.1, 4;
    %pushi/vec4 1, 0, 32;
    %sub;
    %wait E_000001ce3f6208c0;
    %jmp T_0.0;
T_0.1 ;
    %pop/vec4 1;
    %end;
    .scope S_000001ce3f612170;
T_1 ;
    %pushi/vec4 16384, 0, 16;
    %ix/load 4, 0, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 9728, 0, 16;
    %ix/load 4, 1, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 5120, 0, 16;
    %ix/load 4, 2, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 2560, 0, 16;
    %ix/load 4, 3, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 1280, 0, 16;
    %ix/load 4, 4, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 768, 0, 16;
    %ix/load 4, 5, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 256, 0, 16;
    %ix/load 4, 6, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 256, 0, 16;
    %ix/load 4, 7, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 128, 0, 16;
    %ix/load 4, 8, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 64, 0, 16;
    %ix/load 4, 9, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 32, 0, 16;
    %ix/load 4, 10, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 16, 0, 16;
    %ix/load 4, 11, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 8, 0, 16;
    %ix/load 4, 12, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 4, 0, 16;
    %ix/load 4, 13, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 2, 0, 16;
    %ix/load 4, 14, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %pushi/vec4 1, 0, 16;
    %ix/load 4, 15, 0;
    %flag_set/imm 4, 0;
    %store/vec4a v000001ce3f5d6c80, 4, 0;
    %end;
    .thread T_1;
    .scope S_000001ce3f612170;
T_2 ;
    %wait E_000001ce3f620800;
    %jmp T_2;
    .thread T_2;
    .scope S_000001ce3f612170;
T_3 ;
    %wait E_000001ce3f620e80;
    %load/vec4 v000001ce3f606260_0;
    %nor/r;
    %flag_set/vec4 8;
    %jmp/0xz  T_3.0, 8;
    %pushi/vec4 39797, 0, 17;
    %assign/vec4 v000001ce3f6123a0_0, 0;
    %pushi/vec4 0, 0, 17;
    %assign/vec4 v000001ce3f6124e0_0, 0;
    %load/vec4 v000001ce3f603160_0;
    %assign/vec4 v000001ce3f6748d0_0, 0;
    %pushi/vec4 0, 0, 4;
    %assign/vec4 v000001ce3f6080c0_0, 0;
    %pushi/vec4 0, 0, 32;
    %assign/vec4 v000001ce3f605890_0, 0;
    %pushi/vec4 0, 0, 32;
    %assign/vec4 v000001ce3f6043a0_0, 0;
    %jmp T_3.1;
T_3.0 ;
    %load/vec4 v000001ce3f6080c0_0;
    %pad/u 32;
    %cmpi/u 16, 0, 32;
    %jmp/0xz  T_3.2, 5;
    %load/vec4 v000001ce3f6748d0_0;
    %parti/s 1, 15, 5;
    %flag_set/vec4 8;
    %jmp/0xz  T_3.4, 8;
    %load/vec4 v000001ce3f6123a0_0;
    %load/vec4 v000001ce3f6124e0_0;
    %ix/getv 4, v000001ce3f6080c0_0;
    %shiftr 4;
    %add;
    %store/vec4 v000001ce3f612440_0, 0, 17;
    %load/vec4 v000001ce3f6124e0_0;
    %load/vec4 v000001ce3f6123a0_0;
    %ix/getv 4, v000001ce3f6080c0_0;
    %shiftr 4;
    %sub;
    %store/vec4 v000001ce3f674830_0, 0, 17;
    %load/vec4 v000001ce3f6748d0_0;
    %load/vec4 v000001ce3f6080c0_0;
    %pad/u 6;
    %ix/vec4 4;
    %load/vec4a v000001ce3f5d6c80, 4;
    %add;
    %store/vec4 v000001ce3f674330_0, 0, 16;
    %jmp T_3.5;
T_3.4 ;
    %load/vec4 v000001ce3f6123a0_0;
    %load/vec4 v000001ce3f6124e0_0;
    %ix/getv 4, v000001ce3f6080c0_0;
    %shiftr 4;
    %sub;
    %store/vec4 v000001ce3f612440_0, 0, 17;
    %load/vec4 v000001ce3f6124e0_0;
    %load/vec4 v000001ce3f6123a0_0;
    %ix/getv 4, v000001ce3f6080c0_0;
    %shiftr 4;
    %add;
    %store/vec4 v000001ce3f674830_0, 0, 17;
    %load/vec4 v000001ce3f6748d0_0;
    %load/vec4 v000001ce3f6080c0_0;
    %pad/u 6;
    %ix/vec4 4;
    %load/vec4a v000001ce3f5d6c80, 4;
    %sub;
    %store/vec4 v000001ce3f674330_0, 0, 16;
T_3.5 ;
    %load/vec4 v000001ce3f612440_0;
    %assign/vec4 v000001ce3f6123a0_0, 0;
    %load/vec4 v000001ce3f674830_0;
    %assign/vec4 v000001ce3f6124e0_0, 0;
    %load/vec4 v000001ce3f674330_0;
    %assign/vec4 v000001ce3f6748d0_0, 0;
    %load/vec4 v000001ce3f6080c0_0;
    %addi 1, 0, 4;
    %assign/vec4 v000001ce3f6080c0_0, 0;
T_3.2 ;
    %load/vec4 v000001ce3f6123a0_0;
    %parti/s 16, 0, 2;
    %concati/vec4 0, 0, 16;
    %assign/vec4 v000001ce3f605890_0, 0;
    %load/vec4 v000001ce3f6124e0_0;
    %parti/s 16, 0, 2;
    %concati/vec4 0, 0, 16;
    %assign/vec4 v000001ce3f6043a0_0, 0;
T_3.1 ;
    %jmp T_3;
    .thread T_3;
    .scope S_000001ce3f604210;
T_4 ;
    %delay 5000, 0;
    %load/vec4 v000001ce3f6743d0_0;
    %inv;
    %store/vec4 v000001ce3f6743d0_0, 0, 1;
    %jmp T_4;
    .thread T_4;
    .scope S_000001ce3f604210;
T_5 ;
    %wait E_000001ce3f6208c0;
    %load/vec4 v000001ce3f674290_0;
    %addi 1, 0, 32;
    %assign/vec4 v000001ce3f674290_0, 0;
    %jmp T_5;
    .thread T_5;
    .scope S_000001ce3f604210;
T_6 ;
    %pushi/vec4 0, 0, 1;
    %store/vec4 v000001ce3f6743d0_0, 0, 1;
    %pushi/vec4 0, 0, 1;
    %store/vec4 v000001ce3f673f70_0, 0, 1;
    %pushi/vec4 0, 0, 1;
    %store/vec4 v000001ce3f673cf0_0, 0, 1;
    %pushi/vec4 0, 0, 16;
    %store/vec4 v000001ce3f674970_0, 0, 16;
    %pushi/vec4 0, 0, 32;
    %store/vec4 v000001ce3f674290_0, 0, 32;
    %pushi/vec4 2, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %pushi/vec4 1, 0, 1;
    %store/vec4 v000001ce3f673f70_0, 0, 1;
    %pushi/vec4 2, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %vpi_call 2 60 "$display", "Testing 16-bit CORDIC" {0 0 0};
    %vpi_call 2 61 "$display", "=====================" {0 0 0};
    %vpi_call 2 64 "$display", "\012Test 1: Angle 0\302\260" {0 0 0};
    %pushi/vec4 0, 0, 16;
    %store/vec4 v000001ce3f674970_0, 0, 16;
    %pushi/vec4 20, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %load/vec4 v000001ce3f674470_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 68 "$display", "cos(0\302\260) = 0x%08h (%0.3f)", v000001ce3f674470_0, W<0,r> {0 1 0};
    %load/vec4 v000001ce3f674a10_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 69 "$display", "sin(0\302\260) = 0x%08h (%0.3f)", v000001ce3f674a10_0, W<0,r> {0 1 0};
    %vpi_call 2 72 "$display", "\012Test 2: Angle 90\302\260" {0 0 0};
    %pushi/vec4 16384, 0, 16;
    %store/vec4 v000001ce3f674970_0, 0, 16;
    %pushi/vec4 20, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %load/vec4 v000001ce3f674470_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 77 "$display", "cos(90\302\260) = 0x%08h (%0.3f)", v000001ce3f674470_0, W<0,r> {0 1 0};
    %load/vec4 v000001ce3f674a10_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 78 "$display", "sin(90\302\260) = 0x%08h (%0.3f)", v000001ce3f674a10_0, W<0,r> {0 1 0};
    %vpi_call 2 81 "$display", "\012Test 3: Angle 180\302\260" {0 0 0};
    %pushi/vec4 32768, 0, 16;
    %store/vec4 v000001ce3f674970_0, 0, 16;
    %pushi/vec4 20, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %load/vec4 v000001ce3f674470_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 86 "$display", "cos(180\302\260) = 0x%08h (%0.3f)", v000001ce3f674470_0, W<0,r> {0 1 0};
    %load/vec4 v000001ce3f674a10_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 87 "$display", "sin(180\302\260) = 0x%08h (%0.3f)", v000001ce3f674a10_0, W<0,r> {0 1 0};
    %vpi_call 2 90 "$display", "\012Test 4: Angle 45\302\260" {0 0 0};
    %pushi/vec4 8192, 0, 16;
    %store/vec4 v000001ce3f674970_0, 0, 16;
    %pushi/vec4 20, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %load/vec4 v000001ce3f674470_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 95 "$display", "cos(45\302\260) = 0x%08h (%0.3f)", v000001ce3f674470_0, W<0,r> {0 1 0};
    %load/vec4 v000001ce3f674a10_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 96 "$display", "sin(45\302\260) = 0x%08h (%0.3f)", v000001ce3f674a10_0, W<0,r> {0 1 0};
    %vpi_call 2 99 "$display", "\012Test 5: Angle 30\302\260" {0 0 0};
    %pushi/vec4 5461, 0, 16;
    %store/vec4 v000001ce3f674970_0, 0, 16;
    %pushi/vec4 20, 0, 32;
    %store/vec4 v000001ce3f6741f0_0, 0, 32;
    %fork TD_test_cordic_16bit.wait_cycles, S_000001ce3f674ad0;
    %join;
    %load/vec4 v000001ce3f674470_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 104 "$display", "cos(30\302\260) = 0x%08h (%0.3f)", v000001ce3f674470_0, W<0,r> {0 1 0};
    %load/vec4 v000001ce3f674a10_0;
    %cvt/rv/s;
    %pushi/real 1073741824, 4082; load=65536.0
    %div/wr;
    %vpi_call 2 105 "$display", "sin(30\302\260) = 0x%08h (%0.3f)", v000001ce3f674a10_0, W<0,r> {0 1 0};
    %vpi_call 2 107 "$display", "\012Total cycles: %0d", v000001ce3f674290_0 {0 0 0};
    %vpi_call 2 108 "$finish" {0 0 0};
    %end;
    .thread T_6;
# The file index is used to find the file name in the following table.
:file_names 4;
    "N/A";
    "<interactive>";
    "test_cordic_16bit.v";
    "cordic_trig_16bit_working.v";
