|
|
|||||||||||||
|
|
SRC
Insider
|
||||||||||||
|
SRC
Computers, Inc. |
|||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
●
Letter from the CEO ●
SRC-7 Update ●
Software
Update – Carte 2.2 Features Upcoming
Events Recognizes
the year's most significant application utilizing a MAP®
processor $5000
awarded to the winning Lead Developer Entry
deadline is April 30th Click
here for official rules & submission guidelines Unsubscribe If
you wish to no longer receive electronic communications from SRC,
please e-mail marketing@srccomputers.com with REMOVE in
the subject line. |
Letter
from the CEO
Welcome
to the inaugural edition of the SRC Insider, a
newsletter designed to provide regular insight into SRC’s
product and software development. In future issues we also expect
to include reader contributed articles with helpful tips and
application case studies. If you have an article idea, or have
feedback on the Insider in general, please e-mail marketing@srccomputers.com. The
Insider is being sent to everyone who has expressed an interest in
or is currently using an SRC system. but it is also available by
subscribing on our web site at www.srccomputers.com/News_SRC_Insider.htm.
Please also feel
free to forward this newsletter to your colleagues. Should you
wish to unsubscribe, instructions are located in the left hand
column of this newsletter. I
hope you find this publication informative, and we look forward to
your feedback. Jon
Huppenthal
|
||||||||||||
|
MACROS |
=
my_source_macros/mac1.v |
If
you have macros that are for specific MAP types, then you will
have following lines in the Makefile.
|
MAP_C_MACROS |
=
my_source_macros/mac1.v/my_map_c_macros/mac2.vhdl |
|
MAP_E_MACROS |
=
my_source_macros/mac1.v/my_map_c_macros/mac3.v |
Streaming Data Into a CM Module
Data
movement using inbound and outbound streaming memory calls to
external memory connected via GPIO ports is available. There are
some applications that can take advantage of a large CM directly
attached to the GPIO port of a MAP. The user can stream in/out of
the GPIO at a rate of two 64b values every clock. This feature is
not supported on MAP B type MAPs. Tests
in simulation mode are also not supported.
One example could be using the memory as a very large work
space. Another example
would be a "database" of information is kept in CM to be
used by MAP jobs.
void subr (int64_t Src_array[], int64_t Key_array[], int64_t Res_array[],
int sz, int ksz, int mapnum) {
OBM_BANK_A (AL, int64_t, MAX_OBM_SIZE)
OBM_BANK_B (BL, int64_t, MAX_OBM_SIZE)
Stream_64 S0, S1, S2, S3;
int k;
// stream from CPU directly into GPIO memory
#pragma src parallel sections
{
#pragma src section
{
stream_dma_cpu_dual (&S0, &S1, PORT_TO_STREAM, AL, DMA_A_B, Src_array,
1, sz*8);
}
#pragma src section
{
stream_memory (&S0, &S1, STREAM_TO_PORT, GPIO_PORT_0, 0, sz*8);
}
}
// get an array of keys into OBM A
DMA_CPU (CM2OBM, AL, MAP_OBM_stripe (1, "A"), Key_array, 1, ksz*8, 0);
wait_DMA (0);
// for each key, stream data in from GPIO
// mem and count the number of matches
for (k=0; k<ksz; k++) {
printf ("processing key %d...\n", k);
#pragma src parallel sections
{
#pragma src section
{
stream_memory (&S2, &S3, PORT_TO_STREAM, GPIO_PORT_0, 0, sz*8);
}
#pragma src section
{
int i, cnt0, cnt1;
int64_t v0, v1;
for (i=0; i<sz/2; i++) {
get_stream (&S2, &v0);
get_stream (&S3, &v1);
cg_accum_add_32
(1, v0==AL[k], 0, i==0, &cnt0);
cg_accum_add_32 (1, v1==AL[k], 0, i==0, &cnt1);
}
BL[k] = cnt0 + cnt1;
}
}
}
DMA_CPU (OBM2CM, BL, MAP_OBM_stripe (1, "B"), Res_array, 1, ksz*8, 0);
wait_DMA (0);
The
main.c needs to have a GRM call that identifies which MAP is
connected to a CM module. See the following example:
|
map_init_spec
(2); set_map_type
(0, MAP_B); set_map_type
(1, MAP_D); set_map_gpio_mem
(1, GPIO_PORT_1, 4); if
(map_allocate_spec ()) { fprintf
(stderr, "MAP allocation failed\n"); exit where the prototype for set_map_gpio_mem is: |
|
|
int
set_map_gpio_mem (int map_id, int port, int mem_size); |
|
This call specifies a streaming memory module of mem_size GBytes
connected to GPIO port port on MAP map_id. A return
of zero indicates success.
• Synchronization
of MAPs. Applications that execute by running multiple MAPs
concurrently may now synchronize between either the MAPs or
between a MAP and a microprocessor.
Statically Declared Arrays
The
MAP routine may statically initialize small local arrays with data
prior to execution. These arrays may be implemented in LUT-ROM
hardware or BRAM This capability is supported in both C and
Fortran using a subset of the language syntax. These statically
initialized arrays may be in the MAP routine or within inlined
routines to the MAP routine.
LUT arrays are declared in the same way as BRAM constant
arrays. The array's size determines whether it will be implemented
in LUTs or BRAM. Implementing small constant lookup tables in BRAM
can use up valuable BRAM space, so the MAP Compiler instead
implements these arrays of up to 256 elements in the LUTs that
make up the random logic of the FPGA.
The arrays in BRAM can issue 2 reads of statically
initialized arrays in the same clock cycle.
The LUT arrays are single ported, so one access per clock
can take place.
C
code example:
const int8_t T[16] =
{
34,
55, 73, 98, 23, 11, 26, 90,
15,
72, 91, 25, 10, 31, 64, 88
};
Fortran
code example:
integer(kind=1), dimension(16), parameter :: t = (/
&
34, 55,
73, 98, 23, 11, 26, 90,
&
15, 72, 91, 25, 10, 31,
64, 88 /)
See the Programming Guide for more details on the LUT storage given the magnitude of the data values.
Code Preprocessors
There have been several groups that have taken advantage of
performing a preprocessor on the algorithm code before it is
compiled into Carte. Examples
of this would be to generate code via a Perl script.
The Carte standard Makefile and underlying rules that control
the Carte compilation process have been changed for this release.
Support has been added for identifying preprocessors to use in
compilation. Environment variables in the Makefile define the
preprocessor command, any options to the command, a file suffix
that determines which files are to be processed, and another file
suffix defining the file type being produced by the preprocessor.
By default the preprocessors are applied to files in the current
working directory. Optionally, directories can be specified as
locations for files to be preprocessed.
Up to four distinct preprocessors can be specified in the
Makefile. It is also possible for preprocessors to be applied in
sequence to files. This is accomplished by properly specifying the
source and target file suffixes. Any file can be specified for
preprocessing, including code files for the microprocessor, MAP
routines, and macros.
Preprocessing takes place prior to any compilation of source
code, or synthesis of macros. Preprocessing of files is controlled
by Makefile rules and dependencies. Therefore modification of
files requiring preprocessing will trigger invoking the
appropriate preprocessor, just as modifying source files triggers
compilation.
The environment variables that control preprocessing are:
|
PRE1 =
<command> <source suffix> <target suffix>
[<dir1> .. <dirN>] |
The following example shows
specifying preprocessing on a group of files:
|
PRE1 =
pre_cmd pmc mc |
Questions, comments or tips & tricks you would like to share may be directed to david.caliga@srccomputers.com.