/SystemC SystemC FPFA 1 Techno Repo
LSI / 2 Techno Repo
3 Techno Repo
4 Techno Repo
DesignPrototyper 5 Techno Repo
6 Techno Repo
7 Techno Repo
8 Techno Repo
9 Techno Repo
C/C++ C/C++/SystemC IP (Verilog-HDL/ SystemC) DesignPrototyper IP (Verilog-HDL/ SystemC), SystemC TM 1 2 C/C++ 3 4 HDL OSCI SystemC Reference Simulator /Verilator ( Verilog SystemC ) 5 6 Xilinx ISE 10 Techno Repo
FPGA Xilinx ML403 Virtex4 11 Techno Repo
12 Techno Repo
OS / GNU Linux (Vine Linux 2.6/3.2,Redhat Linux 7.x) C++ GNU GCC (3.2.3 / 2.3.2 / 3.4.4 ) SystemC OSCI SystemC Referense Simulator Version 2.0.1 Verilog to C++ Verilator 3.470 http://www.veripool.com/verilator.html EGGX/ ProCALL version 0.80 (Easy and Gratifying Graphics library for X11) http://phe.phyas.aichi-edu.ac.jp/~cyamauch/eggx_procall/ DesignPrototyper Version 3.5.2 / Xilinx ISE WebPack 8.1i 13 Techno Repo
Verilog HDL to C++ Translator Verilator Verilog HDL Verilog HDL C++/SystemC Wilson Snyder, Paul Wasson and Duane Galbi GPL http://www.veripool.com/verilator.html 14 Techno Repo
C 15 Techno Repo
y : (x,y) (x,y ) x x = x cos( ) - y sin( ) y = x sin( ) + y cos( ) x = x cos( ) + y sin( ) y = -x sin( ) + y cos( ) C,, 166 2005 03 28 16 Techno Repo
( ) void rotate( int angle, unsigned int w, unsigned int h ) { int px[4], py[4] ; int qx[4], qy[4] ; int k ; int p_x, p_y, q_x, q_y ; // min_qx = select_min( qx ) ; max_qx = select_max( qx ) ; min_qy = select_min( qy ) ; max_qy = select_max( qy ) ; printf( "min_q=[%d,%d] max_q=[%d,%d] n", min_qx, max_qx, min_qy, max_qy ) ; int min_qx, min_qy ; int max_qx, max_qy ; unsigned short rgb_data ; px[0] = 0 ; py[0] = 0 ; px[1] = w ; py[1] = 0 ; px[2] = w ; py[2] = h ; px[3] = 0 ; py[3] = h ; // for ( k = 0 ; k <= 3 ; k++ ) { rotate_axis( angle, px[k], py[k], &qx[k], &qy[k] ) ; } // for ( q_y = min_qy ; q_y < max_qy ; q_y++ ) { for ( q_x = min_qx ; q_x < max_qx ; q_x++ ) { rotate_axis( -angle, q_x, q_y, &p_x, &p_y ) ; if ( ( p_x >= 0 ) && ( p_x < w ) && ( p_y >= 0 ) && ( p_y < h )) { rgb_data = get_rgb15( FROM, p_x, p_y ) ; put_rgb15( 0, q_x+400, q_y+300, rgb_data ) ; } } } 17 Techno Repo
( ) char gl_c ; // ida signal reg : 7 char gl_s ; // ida signal reg : 7 short int gl_x ; // ida signal reg : 10 short int gl_y ; // ida signal reg : 10 short int gl_xc ; // ida signal reg : 16 short int gl_ys ; // ida signal reg : 16 short int gl_xs ; // ida signal reg : 16 short int gl_yc ; // ida signal reg : 16 void Rotation::rotate_axis( short int angle, short int px, short int py, short int *qx, short int *qy ) { // double th ; // th = angle * M_PI / 180.0 ; // *qx = (double)px * cos(th) - (double)py * sin(th) ; // *qy = (double)px * sin(th) + (double)py * cos(th) ; gl_x = px ; gl_y = py ; gl_c = my_cos(angle) ; gl_s = my_sin(angle) ; // *qx = ( gl_x * gl_c - gl_y * gl_s ) / 64 ; // *qy = ( gl_x * gl_s + gl_y * gl_c ) / 64 ; gl_xc = gl_x * gl_c ; gl_ys = gl_y * gl_s ; gl_xs = gl_x * gl_s ; gl_yc = gl_y * gl_c ; *qx = ( gl_xc - gl_ys ) / 64 ; *qy = ( gl_xs + gl_yc ) / 64 ; } 18 Techno Repo
tiff2txt.c: tiff glib.c: % gcc rotate_main.c rotate.c tiff2txt.c glib.c -lm -L/usr/local/lib -leggx -ltiff -L/usr/X11R6/lib -lx11 -I/usr/X11R6/include %./a.out kamo.tif 30 19 Techno Repo
x y 20 Techno Repo
SystemC 21 Techno Repo
SystemC SystemC,C++ 22 Techno Repo
IO sc_channel BCA IO 23 Techno Repo
/ / C++ ANSI-C IO C/C++ (short int,char, ) SystemC (sc_int,sc_uint,...) (, ) 24 Techno Repo
25 Techno Repo SC_MODULE Rotation
IO (16bit ) void Rotation::vram_read16( unsigned int ad, unsigned short int *rdata ) { unsigned int sram_ad ; unsigned int sram_rdata ; sram_ad = ad >> 1 ; if ( ( ad & 1 ) == 0 ) *rdata = sram_rdata & 0x0000ffff ; else *rdata = sram_rdata >> 16 ; } { // ida cycle_fixed rotation_req.write( true ) ; wait_until( rotation_ack.delayed() == true ) ; rotation_req.write( false ) ; rotation_ad.write( sram_ad ) ; rotation_we.write( false ) ; rotation_cs.write( true ) ; rotation_be.write( 0 ) ; wait() ; rotation_cs.write( false ) ; wait_until( rotation_en_rdata.delayed() == true ) ; sram_rdata = rotation_rdata.read() ; } 26 Techno Repo
IO (16bit ) void Rotation::vram_write16( unsigned int ad, unsigned short int wdata ) { sc_uint<4> var_be ; unsigned int sram_ad ; unsigned int sram_wdata ; sram_ad = ad >> 1 ; if ( ( ad & 1 ) == 0 ) { var_be = 0x03 ; // 4'b0011 sram_wdata = wdata ; } else { var_be = 0x0c ; // 4'b1100 sram_wdata = wdata << 16 ; } { // ida cycle_fixed rotation_req.write( true ) ; wait_until( rotation_ack.delayed() == true ) ; rotation_req.write( false ) ; } rotation_ad.write( sram_ad ) ; rotation_we.write( true ) ; rotation_cs.write( true ) ; rotation_be.write( var_be ) ; rotation_wdata.write( sram_wdata ) ; wait() ; rotation_we.write( false ) ; rotation_cs.write( false ) ; rotation_be.write( 0 ) ; wait() ; } 27 Techno Repo
SC_THREAD rotation_process() void Rotation::rotation_process() { int angle ; unsigned int count ; rotation_req.write( false ) ; rotation_ad.write( 0 ) ; rotation_we.write( false ) ; rotation_be.write( 0 ) ; rotation_cs.write( false ) ; rotation_wdata.write( 0 ) ; rotation_pos_led.write( 0 ) ; rotation_led.write( 0 ) ; angle = 0 ; count = 0 ; image_size_x = 320 ; image_size_y = 200 ; while ( 1 ) { wait() ; wait_until( rotation_start.delayed() == true ) ; wait_until( rotation_start.delayed() == false ) ; rotate( angle, image_size_x, image_size_y ) ; angle += 10 ; if ( angle >= 360 ) { angle -= 360 ; } rotation_led.write( count ) ; count++ ; } } wait() ; 28 Techno Repo
rotate void Rotation::rotate( int angle, int w, int h ) { short int px[4], py[4] ; short int qx[4], qy[4] ; unsigned int k ; short int p_x, p_y, q_x, q_y ; int min_qx, min_qy ; int max_qx, max_qy ; unsigned short rgb_data ; px[0] = 0 ; py[0] = 0 ; px[1] = w ; py[1] = 0 ; px[2] = w ; py[2] = h ; px[3] = 0 ; py[3] = h ; // for ( k = 0 ; k <= 3 ; k++ ) { rotate_axis( angle, px[k], py[k], &qx[k], &qy[k] ) ; } // min_qx = select_min( qx ) ; max_qx = select_max( qx ) ; min_qy = select_min( qy ) ; max_qy = select_max( qy ) ; #ifndef IDA_SYNTH printf( "min_q=[%d,%d] max_q=[%d,%d] n", min_qx, max_qx, min_qy, max_qy ) ; #endif // for ( q_y = min_qy ; q_y < max_qy ; q_y++ ) { for ( q_x = min_qx ; q_x < max_qx ; q_x++ ) { rotate_axis( -angle, q_x, q_y, &p_x, &p_y ) ; if ( ( p_x >= 0 ) && ( p_x < w ) && ( p_y >= 0 ) && ( p_y < h )) { rgb_data = get_rgb15( p_x, p_y ) ; put_rgb15( q_x+400, q_y+300, rgb_data ) ; } } } } 29 Techno Repo
IO 30 Techno Repo
Rotation DesignPrototyper RTL Virtex4 10 100MHz (10ns) % cd./gousei % sc2v.csh -I../src/ROTATION -nomap -clock 10 -target virtex4-10 -o Rotation.v -in../src/rotation/rotation.cpp 31 Techno Repo
Rotation (BCA ) sc_main Rotation_top Rotation.cpp arbiter.cpp SramifMonitor.cpp 32 Techno Repo
Rotation (BCA ) Makefile./Rotation_BCA/Makefile SRC =../src SC_SOURCE = $(SRC)/model/Rotation_main.cpp $(SRC)/model/Rotation_top.cpp $(SRC)/ROTATION/Rotation.cpp $(SRC)/DUT/arbiter.v $(SRC)/model/SramifMonitor.cpp $(SRC)/ROTATION/tiff2txt.c $(SRC)/ROTATION/glib.c run.x:: Makefile.sc make -f Make file.sc Makefile.sc: $(SC_SOURCE) gen_sc_make.awk $(SC_SOURCE) > Makefile.sc list: echo $(Main_SOURCE) include../common/makefile.defs 33 Techno Repo
Rotation (BCA ) SystemC Makefile, % cd Rotation_BCA % make Make file.sc % make run.x %./run.x 34 Techno Repo
RTL sc_main Rotation_top Rotation.cpp vrotation.cpp arbiter.cpp varbiter.cpp SramifMonitor.cpp 35 Techno Repo
Rotation (RTL ) Makefile./Rotation_RTL/Makefile SRC =../src SC_SOURCE = $(SRC)/model/Rotation_main.cpp $(SRC)/model/Rotation_top.cpp../gousei/Rotation.v $(SRC)/DUT/arbiter.v $(SRC)/model/SramifMonitor.cpp $(SRC)/ROTATION/tiff2txt.c $(SRC)/ROTATION/glib.c run.x: Makefile.sc make -f Makefile.sc Makefile.sc: $(SC_SOURCE) gen_sc_make.awk $(SC_SOURCE) > Makefile.sc list: echo $(SC_SOURCE) include../common/makefile.defs 36 Techno Repo
Rotation (RTL ) SystemC Makefile, % cd CG3d_RTL % make Make file.sc % make run.x %./run.x 37 Techno Repo
Verilator Verilog HDL SystemC Verilator Verilog HDL SystemC % verilator.csh --sc Rotation.v a[15:0] b[15:0] to_uint32t<16> to_uint32t<16> Rotation vrotation from_uint32t<18> Verirator SystemC RTL rotation_cs start start rotation_we clk clk reset a b reset rotation_ad rotation_ad[17:0] rotation_we./obj_dir/vrotation.h./obj_dir/vrotation.cpp./obj_dir/rotation.h./obj_dir/rotation.cpp Velirator SystemC 2bit 32bit uint32_t bit Rotation,SystemC 38 Techno Repo
Verilator SystemC Verilog HDL Verilog HDL SystemC Verilog HDL RTL Task Verilog HDL 39 Techno Repo
ISE / 40 Techno Repo
rotate_axis (sc_module) rotate CPU : px[0] = 0 ; py[0] = 0 ; px[1] = w ; py[1] = 0 ; px[2] = w ; py[2] = h ; px[3] = 0 ; py[3] = h ; for ( k = 0 ; k <= 3 ; k++ ) { rotate_axis( angle, px[k], py[k], &qx[k], &qy[k] ) ; } min_qx = select_min( qx ) ; max_qx = select_max( qx ) ; min_qy = select_min( qy ) ; max_qy = select_max( qy ) ; 41 Techno Repo
: CRT Transaction Level SRAM SRAM CRT FPGA 42 Techno Repo
SystemC/Verilator SystemC/Verilator PLI BCA RTL Verilog HDL 43 Techno Repo
C /SystemC FPGA,MPU,... (SystemC BCA ) 44 Techno Repo
45 Techno Repo
FPGA Xilinx Spartan3 Starter kit. http://www.xilinx.com/ products/spartan3/s3boards.htm 46 Techno Repo
FPGA Spartan-3 Platform FPGA XC3S200-4FT256C 200,000 gate Platform Flash Configuration PROM XCF02S 2Mbit 3-bit, 8-color VGA display port Fast Asynchronous SRAM (512Kx16 or 256Kx32) Spartan-3 Starter Kit Board User Guide Page12. http://www.xilinx.com/bvdocs/userguides/ug130.pdf 50 MHz crystal clock oscillator 47 Techno Repo
48 Techno Repo
CQ Interface C 49 Techno Repo
50 Techno Repo
51 Techno Repo
52 Techno Repo