<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=ICE_Help_CORES</id>
	<title>ICE Help CORES - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=ICE_Help_CORES"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=ICE_Help_CORES&amp;action=history"/>
	<updated>2026-08-20T16:23:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=ICE_Help_CORES&amp;diff=555&amp;oldid=prev</id>
		<title>ConvertBot: Interface to FPGA Cores</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=ICE_Help_CORES&amp;diff=555&amp;oldid=prev"/>
		<updated>2020-04-27T18:32:57Z</updated>

		<summary type="html">&lt;p&gt;Interface to FPGA Cores&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;background-color: #eef9ff; border: 1px solid #999; padding: 10px;&amp;quot;&amp;gt;[[ICE_Help|&amp;amp;uarr; ''Go to the full list of ICE Help pages'']].&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
'''Summary:''' Interface to FPGA Cores&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file contains a brief description of the current interface for user&lt;br /&gt;
FPGA cores within the ICE FPGA architecture.  An ICE Core is an FPGA module&lt;br /&gt;
with a set of function registers, two dataflow ports, and a test output port.  &lt;br /&gt;
&lt;br /&gt;
The verilog implementation signature looks like this:&lt;br /&gt;
&lt;br /&gt;
 module userengine (sclk,srst, scs,saddr, swr,swrbus, srd,srdbus, sack,&lt;br /&gt;
 ioclk, istat,iena,isel,ibus, ostat,oena,osel,obus, test);&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 module mcengine (sclk,srst, scs,saddr, swr,swrbus, srd,srdbus, sack,&lt;br /&gt;
 ioclk, istat,iena,isel,ibus, ostat,oena,osel,obus, test);&lt;br /&gt;
&lt;br /&gt;
The MultiCore engines are used to handle channelized functions.  &lt;br /&gt;
They can contain 1-16 single channel cores using a common input stream.&lt;br /&gt;
&lt;br /&gt;
If you have access to the ICE FPGA development tree, the full files are&lt;br /&gt;
$ICEROOT/code/soc/lib/userengine.v and $ICEROOT/code/soc/lib/mcengine.v.&lt;br /&gt;
&lt;br /&gt;
=== Setup - Setting up a core for use in a dataflow&amp;lt;span id=&amp;quot;Setup&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The FPGA's 32 bit system bus connects to the core's functional registers.  &lt;br /&gt;
These are for setting up parameters, loading coefficients, reading status, or &lt;br /&gt;
other debugging tasks.  The register at the base address of each core is the &lt;br /&gt;
core's system register and is predefined for all cores.  The next seven &lt;br /&gt;
registers are reserved for standard ICE control parameters. All other registers &lt;br /&gt;
are user defined.  The system clock is usually between 100 and 200 MHz.  It &lt;br /&gt;
can be changed at compile time by editing the `define CLKF_xxx in mdefs.h.&lt;br /&gt;
All user processing should use this clock.&lt;br /&gt;
&lt;br /&gt;
The IO bus connects the input and output dataflow ports to the DMA crossbar.&lt;br /&gt;
The crossbar is a 64 byte packet based router that can handle simultaneous &lt;br /&gt;
connections to/from memory and multiple connections directly between modules.&lt;br /&gt;
The IO bus is either 32 or 64 bits wide depending on where the module is&lt;br /&gt;
instantiated.  It is suggested to run the dataflow ports to the ICE reformat&lt;br /&gt;
modules to convert different data types to/from the core's native data type,&lt;br /&gt;
and to the cores system clock.  The ioclk is between 166Mhz and 200MHz.  &lt;br /&gt;
It has no relationship to any external data input/output or sampling clocks.&lt;br /&gt;
&lt;br /&gt;
A core will typically be set up through a call to pic_ioport() with the port&lt;br /&gt;
type set to IOPT_CORE.  Using the returned dma channel, the user can then set&lt;br /&gt;
any user parameters with pic_setkey() or a block of parameters with pic_wpm().&lt;br /&gt;
The dataflow routing is directed by the IPORT and OPORT flags in the call to&lt;br /&gt;
pic_ioport().  When pic_dmafunc() is called on this dma channel with the &lt;br /&gt;
DMA_ONESHOT or DMA_CONTINUOUS mode, the routes are enabled and data will begin &lt;br /&gt;
flowing to the core's input port.  Data is throttled via the ready lines istat&lt;br /&gt;
and ostat.&lt;br /&gt;
&lt;br /&gt;
The icelib.c routines are C, Fortran, or Java callable.&lt;br /&gt;
&lt;br /&gt;
If you are running X-Midas or NeXtMidas, the ICECORE primitive can be used to &lt;br /&gt;
setup the user registers, or the PICD SET and PICD GET commands.  For example:&lt;br /&gt;
&lt;br /&gt;
 ICECORE/core=V ifile ofile &amp;quot;User&amp;quot; {P8=123,P9=456} /dump=2&lt;br /&gt;
&lt;br /&gt;
runs any Verilated core with the generic &amp;quot;User&amp;quot; core interface, in this case setting &lt;br /&gt;
register 8 to 123 and register 9 to 456.  The actual run-time contents of these two&lt;br /&gt;
registers is queried and dumped to the screen for debug.&lt;br /&gt;
&lt;br /&gt;
To graphically examine the signal traces for the Verilog run, set the unix environment &lt;br /&gt;
variable VERILATOR_TFN to a filename to recieve the test vector output.  Install gtkwave&lt;br /&gt;
version 3.3.42 or later and run it with this filename as the first argument.&lt;br /&gt;
&lt;br /&gt;
To create test vectors for Concurrent-EDA's automated C-to-FPGA process, set the&lt;br /&gt;
unix environment variable ICECORE_TFN to a filename root to recieve the test vectors.&lt;br /&gt;
It will create the ${ICECORE_TFN}_pin, _pout, _din, and  _dout files for the core's &lt;br /&gt;
configuration plan in, and plan out per pass, the input data, and expected output data.&lt;br /&gt;
&lt;br /&gt;
[[ICE_Help_CARDS|See HELP CARDS]] ICECORE for other switches.&lt;br /&gt;
&lt;br /&gt;
For testing the FPGA code on an actual ICE card with non-realtime dataflow, &lt;br /&gt;
make sure the card is reset with the proper flags such as&lt;br /&gt;
&lt;br /&gt;
 PIC RESET PIC1 /flags=PMFPGA=U&lt;br /&gt;
&lt;br /&gt;
to load the user FPGA code. Then run the ICECORE routine with additional switches&lt;br /&gt;
specifying the card alias and core number to use.&lt;br /&gt;
&lt;br /&gt;
 ICECORE/core=I ifile ofile &amp;quot;User&amp;quot; {P8=123,P9=456} /dump=2 /coredev=PIC1:21&lt;br /&gt;
&lt;br /&gt;
For more examples of macros using these routines, see $ICEROOT/fat/testcore.mm,&lt;br /&gt;
 $ICEROOT/fat/testnoop.mm  $ICEROOT/fat/testuser.mm $ICEROOT/fat/testdemod.mm.&lt;br /&gt;
&lt;br /&gt;
Currently, the realtime dataflow must still use the SOURCEPIC/SINKPIC primitives.&lt;br /&gt;
&lt;br /&gt;
 SOURCEPIC/PORT=PM1CORE1 ramfile _out PIC1AUTO &lt;br /&gt;
 PICDRIVER/PORT=PM1CORE1 set PIC1AUTO CORE+32 123&lt;br /&gt;
 PICDRIVER/PORT=PM1CORE1 set PIC1AUTO CORE+36 456&lt;br /&gt;
&lt;br /&gt;
will set this up the same core using the realtime dataflow on an ICE card.&lt;br /&gt;
&lt;br /&gt;
=== Naming - Core naming rules&amp;lt;span id=&amp;quot;Naming&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
The two cores on the main board are named PM0CORE1 and PM0CORE2.&lt;br /&gt;
Cores on processor module 1 are named CORE11, CORE12, MCORE11, and MCORE12 ( or PM1CORE1 and PM1CORE2).&lt;br /&gt;
Cores on processor module 2 are named CORE21, CORE22, MCORE21, and MCORE22 ( or PM2CORE1 and PM2CORE2).&lt;br /&gt;
&lt;br /&gt;
=== Addressing - Register addressing rules&amp;lt;span id=&amp;quot;Addressing&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
Each core has a set of 32bit wide registers that are read/writable through the&lt;br /&gt;
pic_setkey, pic_getkey, pic_wpm, and pic_rpm routines.  Each core has a 24 bit &lt;br /&gt;
register address window with a base address (upper 8 bits) defined in iceppc.h.&lt;br /&gt;
Use the FLG_PPC_BUS flag on pic_wpm and pic_rpm calls to address the system &lt;br /&gt;
register bus and the KEY_CORE key for the pic_setkey and pic_getkey calls.&lt;br /&gt;
&lt;br /&gt;
The first register address is the System register set by the system software whenever a core is activated.&lt;br /&gt;
&lt;br /&gt;
# System Register (bit 0 is enable, bit 1 is play/acq, bits[11:8] input format, [15:12] output format))&lt;br /&gt;
&lt;br /&gt;
 Input/Output formats: bit[2:0]? 0=16b 1=8b 2=4b 3=1b 4=32b  bit[3]?complex:real&lt;br /&gt;
&lt;br /&gt;
The next 7 register addresses are pre-defined and set by every call to pic_ioport on a CORE or MCORE.&lt;br /&gt;
&lt;br /&gt;
# Decimation (dec-1)&lt;br /&gt;
# Gain&lt;br /&gt;
# Rate (Hz)&lt;br /&gt;
# Ratio (fractional binary)&lt;br /&gt;
# Frame (frame-1)&lt;br /&gt;
# Frequency (fractional binary)&lt;br /&gt;
# Flags&lt;br /&gt;
&lt;br /&gt;
The next 8 are reserved for other system routines.&lt;br /&gt;
&lt;br /&gt;
 8..15) Filter coef loaders&lt;br /&gt;
&lt;br /&gt;
The rest are available for user core parameters.&lt;br /&gt;
&lt;br /&gt;
 16..255) User parameters for each multicore.&lt;br /&gt;
 16..1M)  User parameters for each core.&lt;br /&gt;
&lt;br /&gt;
The user registers are not written or cleared by system software.&lt;br /&gt;
&lt;br /&gt;
See the help on each of these routines for detailed syntax.&lt;br /&gt;
&lt;br /&gt;
=== Routing - data routing rules&amp;lt;span id=&amp;quot;Routing&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
Each core has one data input stream and one data output stream.  &lt;br /&gt;
The multi-channel cores also have an 8-bit channel select with each of these streams.&lt;br /&gt;
The run-time routing is handled via the IPORT and OPORT flags in the handle given&lt;br /&gt;
to the pic_ioport call.  &lt;br /&gt;
&lt;br /&gt;
The default route for an acquisition is IPORT=MODULEx (where x=1|2 to be on the same side &lt;br /&gt;
of the card and OPORT=HOST.  The default route for playback is IPORT=HOST and OPORT=MODULEx.&lt;br /&gt;
&lt;br /&gt;
=== DMA - DMA Crossbar functionality&amp;lt;span id=&amp;quot;DMA&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
The DMA engine does not transfer back-to-back packets to the same core.  This allows &lt;br /&gt;
at least 8 clocks to register the proper IO ready lines for the next transfer.  The enable &lt;br /&gt;
lines are also one cycle ahead of the actual transfer so that modules can register or&lt;br /&gt;
preload data to ease timing considerations.&lt;br /&gt;
&lt;br /&gt;
=== Tracer - Embedded FPGA debug trace mechanism&amp;lt;span id=&amp;quot;Tracer&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; ===&lt;br /&gt;
If a FPGA core module contains an instance of swrstatdbg, the unit can be&lt;br /&gt;
tested while live using ICETEST TRACER from then nextmidas prompt.&lt;br /&gt;
See the explain of ICETEST for more info.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
[[Category:ICE_Help]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>