Gaj 1 MAPLD 2005/1016 Development and Maintenance of User Libraries for SRC Reconfigurable Computers Kris Gaj 1 , Tarek El-Ghazawi 2 , Paul Gage 3 , Dan Poznanovic 3 , Chang Shu 1 , Deapesh Misra 1 , Miaoqing Huang 2 , Esam El- Araby 2 , Mohamed Taher 2 1 George Mason University 2 The George Washington University 3 SRC Computers, Inc.
56
Embed
Gaj1MAPLD 2005/1016 Development and Maintenance of User Libraries for SRC Reconfigurable Computers Kris Gaj 1, Tarek El-Ghazawi 2, Paul Gage 3, Dan Poznanovic.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Gaj 1 MAPLD 2005/1016
Development and Maintenance of User Libraries for
SRC Reconfigurable Computers
Kris Gaj1, Tarek El-Ghazawi2, Paul Gage3, Dan Poznanovic3,
Chang Shu1, Deapesh Misra1,
Miaoqing Huang2, Esam El-Araby2,
Mohamed Taher2
1 George Mason University2 The George Washington University3 SRC Computers, Inc.
Gaj 2 MAPLD 2005/1016
ReconfigurableComputers
Gaj 3 MAPLD 2005/1016
Interface
P memory
P memory
. . .
P P . . .
I/O Interface
FPGA memory
FPGA memory
. . .
FPGA FPGA . . .
I/O
Microprocessor system FPGA system
What is a reconfigurable computer?
Gaj 4 MAPLD 2005/1016
Examples of High-End Reconfigurable Computers
• SRC-6E and SRC High-Bar Based Systems from SRC Computers, Inc.
• Cray XD1 (formerly Octiga Bay 12 K) from Cray Inc.
• SGI Altix 3000 from Silicon Graphics
• Star Bridge Hypercomputer from Star Bridge Systems
• Hi-Bar sustains 1.4 GB/s per port with 180 ns latency per tier• Up to 256 input and 256 output ports• Common Memory (CM) has controller with DMA capability• Up to 8 GB DDR SDRAM supported per CM node
PCI-XPCI-XPCI-XPCI-X
SRC Hi-Bar Based Systems
MAPMAP®®
SRC-6SRC-6
MAPMAP
PP
MemoryMemory
SNAPSNAP™™
PP
MemoryMemory
SNAPSNAP
Gig EthernetGig Ethernetetc.etc.
Common Common MemoryMemory
ChainingChainingGPIOGPIO
Common Common MemoryMemory
SRC Hi-Bar SwitchSRC Hi-Bar Switch
Source: [SRC, MAPLD04]
Gaj 8 MAPLD 2005/1016
SRC Programming
HLL (C)
HDL (VHDL)
SRCP system
FPGA system
ApplicationProgrammer
LibraryDeveloper
Gaj 9 MAPLD 2005/1016
C function for P
C function for FPGAs
VHDL macro for FPGAs
SRC Program Partitioning
P system
FPGA system
HLL
HDL
Gaj 10 MAPLD 2005/1016
Main program
Function_1(a, d, e)
Function_2(d, e, f)
Function_1
Function_2
Macro_1(a, b, c)
Macro_2(b, d)Macro_2(c, e)
Macro_3(s, t)
Macro_1(n, b)Macro_4(t, k)
FPGA……
……
……
Macro_1
Macro_2 Macro_2
a
b c
d e
FPGA contents afterthe Function_1 call
Program in C or Fortran
Run Time Reconfiguration in SRC
Gaj 11 MAPLD 2005/1016
SRC Development Environment
Objectfiles
Application sources
MAP CompilerP Compiler
Logic synthesis
Place & Route
Linker.bin files
.edf files
.o files .o files
Applicationexecutable
Configurationbitstreams
HDLsources.c or .f files .vhd or .v files
Objectfiles
Application sourcesUser
Macro Sources
MAP CompilerP Compiler
Logic synthesis
Place & Route
Linker
.edf files
.bin files
. files
.o files .o files
Applicationexecutable
Configurationbitstreams
HDL
.c or .f files .vhd or .v files
.v files
Gaj 12 MAPLD 2005/1016
Advantages of reconfigurable computers
• can be programmed by mathematicians themselves using traditional programming languages or GUI environments
• encourage innovation and experimentation
• general-purpose: cost distributed among multiple users with different needs
• behave like hardware: - parallel processing - distributed memory - specialized functional units, etc.
Gaj 13 MAPLD 2005/1016
Conditions necessary for the success of reconfigurable computers
• ease of use of library macros and functions
• existence of comprehensive libraries of user macros and functions capable of running on FPGAs
• significant speed-ups ( 100 x) of basic functions running on FPGAs compared to state-of-the-art microprocessors
Gaj 14 MAPLD 2005/1016
Development and Maintenance of SRC
Libraries
Gaj 15 MAPLD 2005/1016
Structure of the macro repository < top of repository >
<lib # 1 >
common rev_d rev_e
hdlfile InfoFile BlkBoxFile
macro1 macro2 macro3
< macros >
<lib # 2 > <lib # 3 >
rev_f
DebugCodeFile
DataSheet
Gaj 16 MAPLD 2005/1016
common: • These are macros that have no connections to external
pins nor to any specific FPGA type specific feature. This type of macro can be used on any MAP
rev_d: • These macros have a specific dependency on the dual MAP
rev_e: • These macros have a specific dependency on the single
MAP rev_f:
• These macros have a specific dependency on compact MAP
Macro Types
Gaj 17 MAPLD 2005/1016
Files describing the macro
Platform independent HDL file: macro.v or macro.vh
• Verilog or VHDL code defining the macro
Debug Code File: macro.c • provides the equivalent C functionality for the macro
Platform dependent Blk Box File: blackbox.v
• Interface (black box) definition for the macro in Verilog
Data sheet file: datasheet• contains the documentation for the macro
Info File: info• Info file entry for the given macro, containing macro type, latency, names of input/output/control signals, etc.
Gaj 18 MAPLD 2005/1016
To properly manage a distribution of macros a CVS repository must be setup.
This allows the source code changes to be controlled and permits multiple developers
to work on the code.
CVS repository
Gaj 19 MAPLD 2005/1016
The Installed Macro Library Structure
<xxx lib>
map 3 (built for the Xilinx Virtex2) map 4 (built for the Xilinx Virtex2Pro)
common rev_d rev_e
ngo blkbox.v macros.info
macro1 macro2 macro3 ......
common rev_d rev_e
Single info file
Single blackbox file
Obtained by running a special script developed by SRC
Gaj 20 MAPLD 2005/1016
Library Script
Usage:
build_libs [OPTION][-b, --branch br] Specify CVS branch[-c, --checkout] Checkout only[-d, --CVSROOT cvsroot] Specify CVSROOT[-M, --MAP maptype] Build for MAP maptype[-m, --module mod] Build mod only[-r, --restart mmddyy-hhmm] Restart previous build[-s, --step target] Run build step target[-v, --version N.n] Package as version N.n[-V, --vendor vend] Specify distribution vendor[-w, --workspace path] Create workspace in path
Gaj 21 MAPLD 2005/1016
Building libraries
• build_libs will checkout library and perform a build in /var/tmp/builds in a folder with a time stamp (i.e. 080405-1705)
• If there is an error check file called ‘output’ in the /var/tmp/builds. Fix the error and restart build by:
• build_libs --restart 080405-1705• You can also do a partial build, say only build
the library and not the CD• build_libs --step lib
• To build only a particular subset of a library, you can do so using a command such as:
• build_libs --module crypto
Gaj 22 MAPLD 2005/1016
Structure for the repository of MAP C functions
< top of repository >
<lib # 1 >
common rev_d rev_e
routine1 routine2 routine3
< userlib >
<lib # 2 > <lib # 3 >
rev_f
Gaj 23 MAPLD 2005/1016
Source file: • This is the .mc or .mf file defining the MAP routine
proto.h: • This file provides a prototype of the MAP routine
Makefile: • This is a standard Carte Makefile, with the exception that no BIN
environment variable is provided.
Docfile:• This file provide a man page format documentation
of the MAP routine.
Files describing the MAP C routine
Gaj 24 MAPLD 2005/1016
The Installed MAP Routine Library Structure
<userlib >
map 3 map 4
common rev_d rev_e
lib1.a lib1.so lib2.a
common rev_d rev_e
lib2.so ......
Gaj 25 MAPLD 2005/1016
Known problems:No support for variable size
of operands
Gaj 26 MAPLD 2005/1016
We would like to be able to create and maintain a library of generic components that work for various operand sizes.
for (i=0; i<3*N+1; i++) { if (i < N) A_in = c[i]; B_in = d[i]; else A_in = 0; B_in = 0;
mul (i, A_in, B_in, &C_out);
if (i > N) e[i-N] = C_out;}
Gaj 30 MAPLD 2005/1016
Passing variable size operandsusing streams
#pragma src section { for (i=0; i<N; i++) { put_stream (&S0, A[i], 1); // put A[i] to S0 put_stream (&S1, B[i], 1); // put B[i] to S1 } } #pragma src section { mul (&S0, &S1, &S2); // read from S0 and S1, write to S2 } #pragma src section { for (i=0; i<2*N; i++) get_stream (&S2, &C[i]); // take from S2 and write to C[i] }
Gaj 31 MAPLD 2005/1016
Process Process
Gaj 32 MAPLD 2005/1016
Multiprecision Integer Library Generator
Multiprecision Integer Library
Generator(C engine)
C/VHDL Wrapper
Black Box Info file
Size of operands - N
In-line MAP Cfunction
Gaj 33 MAPLD 2005/1016
Inline MAP C functionfor N=2
int mul (int64_t *A, int64_t *B, int64_t *C, N){int64_t A0, A1;int64_t B0, B1;int64_t C0, C1, C2, C3;
Cons: need to generate automatically several macro files,
need for changes in the compiler
Gaj 35 MAPLD 2005/1016
GMU/GWU Libraries
Gaj 36 MAPLD 2005/1016
Cryptographic Libraries
Secret Key Ciphers
Secret key ciphers encryption and breaking – SecCiph
Public Key Ciphers • Elliptic Curve Cryptosystems arithmetic - ECC• Binary Galois Field GF(2m) arithmetic in Polynomial Basis - GF2n_PB• Binary Galois Field GF(2m) arithmetic in Normal Basis - GF2n_NB• Multiprecision integer arithmetic (in collaboration with University of South Carolina) – Long_Int• Operations supporting factorization of large integers using Number Field Sieve - NFS