Platform Developer’s Kit PDK Tutorial Manual
PAL tutorial PalVideoOutWrite (VideoOut, {24-bit expression}); Getting run-time information from the resource Some PAL resources return run-time in
Tutorial: Using the logic estimator 9 FIR Tutorial The FIR tutorial illustrates how to implement a FIR (Finite Impulse Response) filter using Handel
Tutorial: Using the logic estimator When the coefficients are symmetrical, pairs of samples taken from the start and end of the series can be added
Tutorial: Using the logic estimator /* * Structure of variables to interface to FIR filter */ struct _FirStruct { unsigned 1 InputValid; u
Tutorial: Using the logic estimator The FirFilter macro contains the code to perform the actual FIR filtering. Before the filter starts operation, t
Tutorial: Using the logic estimator par { FirPtr->Output = Accumulator; FirPtr->OutputValid = 1; } The main function in fir1.hcc is se
Tutorial: Using the logic estimator SETTING THE CHIP TYPE Now select the Synthesis tab and ensure that the settings are exactly as shown below, with
Tutorial: Using the logic estimator Finally, select the Linker tab, and check that Generate estimation info is enabled. LINKER SETTINGS www.celoxi
Tutorial: Using the logic estimator Now rebuild the project for EDIF, and open Summary.html in the folder PDK/Tutorials/General/TutorialFIR/Version1
Tutorial: Using the logic estimator The replicated par{} builds a copy of the line of code it contains for every tap in the FIR, and all the lines a
Tutorial: Using the logic estimator A more efficient adder tree in terms of logic delay is shown below: result7 6 5 4 3 2 1 0 IMPROVED ADDER TREE Sh
PAL tutorial macro expr UsingButtons = PalSwitchCount () > 1; macro expr UsingMouse = !UsingButtons && (PalPS2PortCount () > 0); The
Tutorial: Using the logic estimator LOGIC ESTIMATION SUMMARY FOR VERSION2 PROJECT LONGEST PATH SUMMARY FOR VERSION2 PROJECT The RecurseAdd macro ex
Tutorial: Using the logic estimator The logic estimator summary and longest path is shown below. This summary can be viewed by building the project
Tutorial: Using the logic estimator the adder tree. Note that the logic area in the Estimator Summary is larger for the Version2 and Version3 projec
Tutorial: Using the logic estimator struct _FirStruct { signed Input; signed Output; signed Coeffs[]; }; macro proc FirWrite (FirPtr, Da
Tutorial: Using the logic estimator LOGIC ESTIMATION SUMMARY FOR VERSION3 PROJECT 9.5 Reducing logic area There is one final optimization which we
Tutorial: Using the logic estimator FIR TAKING ADVANTAGE OF SYMMETRICAL COEFFICIENTS The FIR filter can easily be modified to take advantage of symm
Tutorial: Using the logic estimator In the summary from the Logic Estimator below, the hardware usage can be seen to be significantly reduced from
Tutorial: Using the logic estimator 9.6 Using ALU Mapping One of the new features introduced in DK 3.0 was ALU Mapping. This is only supported on FP
Tutorial: Using the logic estimator Open the alumapping1 project in the TutorialFIR workspace, accessible from Start>Programs>Celoxica>Plat
Tutorial: Using the logic estimator Compared to the summary for the previous project (Reducing logic area), it can be seen that the number of LUTs a
PAL tutorial 1.5 PAL Tutorial Part 3 The Part3 project in the PAL tutorial describes how to use an external RAM. The RAM is initialized and run from
Tutorial: Using the logic estimator LONGEST PATH SUMMARY FOR ALUMAPPING1 PROJECT Our goal is now to reduce the delay on this path further. We will d
Tutorial: Using the logic estimator To simplify the Handel-C code required to implement this adder tree, we will declare a 2-dimensional array, as w
Tutorial: Using the logic estimator Open the alumapping2 project in the TutorialFIR workspace, accessible from Start>Programs>Celoxica>Plat
Tutorial: Using the logic estimator The longest path is now through the multiplier again, but as this is now an embedded ALU, it is not possible to
Tutorial: Using the logic estimator The next step is to switch on the retimer. The settings for retiming are accessed through the Project->Settin
Tutorial: Using the logic estimator RETIMER OUTPUT DURING BUILD In this you can see that the retimer has found a path with a delay of 27.31ns - whic
Tutorial: Using the logic estimator 9.9 Improving performance with retiming The previous version of the FIR (Using Retiming) used retiming but did n
Tutorial: Using the logic estimator www.celoxica.com Page 127
FIR Tutorial 10 Index A add tree...107, 114 ALU Mapping...93, 117, 119 arra
PAL tutorial par { PalVideoOutRun (VideoOut); PalFastRAMRun (FastRAM); // main program here } Enabling the RAM resource Once the RAM
FIR Tutorial device drivers 29, 30 examples 28, 31, 32, 38 tutorials 28 R RAM use...72 recursi
PAL tutorial 2 DSM tutorials There are two Data Stream Manager tutorials: • Pattern matching tutorial: a simple example, targeting the DSM Simulati
PAL tutorial 6. Open the tutorial MSVC workspace: Start>Programs> Celoxica>Platform Developer's Kit>DSM>DSM Tutorial Workspace
PAL tutorial DsmInstance *Instance; DsmPortS2H *DataOutPort; DsmPortH2S *MatchInPort; int DsmTutorial (DsmInterface Interface, void *InterfaceData
PAL tutorial DsmInstance *Instance; DsmPortS2H *DataOutPort; DsmPortS2H *PatternOutPort; DsmPortH2S *MatchInPort; int DsmTutorial (DsmInterface
PAL tutorial 2.2 DSM FIR filter tutorial 2.2.1 Introduction The DSM FIR filter tutorial connects a FIR filter to a processor using DSM. The applicat
PAL tutorial • RS-232 Serial cable Optionally from MathWorks for MV2P Target: • MATLAB 7.0.1 (Release 14). Other versions might work, but have not
PDK Tutorial Manual Celoxica, the Celoxica logo and Handel-C are trademarks of Celoxica Limited. All other products or services mentioned herein may
PAL tutorial FIRFilter (FIRPortH2S, FIRPortS2H); DsmVideo (VideoPortS2H, VideoPortH2S, VideoPL1RAM, PAL_ACTUAL_CLOCK_RATE); } DSM FIR filte
PAL tutorial (unsigned) adjs (Output, width(DsmWord))); DsmFlush (PortH2S); } } }
PAL tutorial printf ("Output = %d\n", Output); #if defined WIN32 || defined __MICROBLAZE__ if (i != 0) {
PAL tutorial 6. Open the MSVC Examples workspace from the start menu: Start>Programs> Celoxica>Platform Developer's Kit>DSM>DSM
PAL tutorial DSM SIM MONITOR CONTENTS 2.2.5 Running the tutorial in hardware The DSM FIR filter tutorial workspace is configured to automatical
PAL tutorial Building the hardware side 1. Make sure that the board is connected to your PC with a parallel cable before you build the hardware. 2.
PAL tutorial Building the software side The software is built before generation of the BIT file. You must run the terminal program before the BIT fi
PAL tutorial 6. You can compare the results gnerated from the board with the results generated in matlab by running the dsm_fir_ref.m script. MATL
DSM tutorials 3 Platform Support Library tutorial 3.1 Introduction A Platform Support Library (PSL) is a Handel-C library containing functions for c
DSM tutorials 3.3 Creating a PSL To create a PSL you compile the device drivers that match the peripherals on your target platform into a Handel-C
PDK Tutorial Manual Contents 1 PAL TUTORIAL ...
DSM tutorials • How fast does it need to run • Can it function independently of the system clock frequency • Can you perform multiple instantiati
DSM tutorials Step 4: Implement procedures for the device interface Wrap communication with the Handel-C interfaces inside macro procedures. You sho
DSM tutorials Now define a Handel-C interface to attach this pin to a Handel-C variable. Use the Handel-C bus_out interface as the pin is an output
DSM tutorials Here are macro expressions for the RAM pins: static macro expr RAMAddrBus = {"A1", "A2","A3"
DSM tutorials in this example. The DK online help contains more information about timing constraints. To locate this information select the Index ta
DSM tutorials You can capture this equation in a Handel-C macro expression and use it to evaluate the required number of clock cycles at compile tim
DSM tutorials HANDEL-C RAM READ The timing for a write operation given in the data sheet corresponds to this diagram: RAM WRITE OPERATION Th
DSM tutorials In order to guarantee the write enable is active only when the data and address are valid, the operation must be performed over three
DSM tutorials macro proc RAMWrite (Address, Data) { par { seq { par { RAMAddress = A
DSM tutorials • write enable pin (input) • status pin (output) • byte enable pin (input) The device can operate in 16 bit data or 8 bit data mode
PDK Tutorial Manual 5.3 ADDING MOUSE INPUT ... 68 6 TUTORIAL:
DSM tutorials The structure that contains variables shared between the server and API functions also contains expressions for the interfaces to the
DSM tutorials DataBusConnects the server to the input expression of the flash data bus interface. StatusBusConnects the server to the input expressi
DSM tutorials macro proc FlashRun (FlashPtr, ClockRate) { // Initialization sequence unsigned 3 Command; do { FlashPtr-&g
DSM tutorials macro proc FlashWriteWord (FlashPtr, Address, Data) { par { FlashPtr->APICommand ! FlashAPICommandWriteWord;
DSM tutorials static macro expr FlashAddrPins = { "A17", "D15", "C16", "D14", "E14", "A1
DSM tutorials • Making a driver portable (see page 55) 4.1 Handel-C language basics The TutorialHCBasics workspace illustrates the use of some of
DSM tutorials while (1) { /* * Run the two displays in parallel */ par { seq { /* * I
DSM tutorials Swapping variable values The swapexample project in the TutorialHCBasics workspace shows how the values of two variables can be exchan
DSM tutorials par { while (1) { unsigned 1 Temp; do { par { Count++;
DSM tutorials The channelexample project is straightforward to run in hardware, but in simulation breakpoints must be set in each of the two paralle
PDK Tutorial Manual Conventions The following conventions are used in this document. 2 Warning Message. These messages warn you that actions may da
DSM tutorials Take operator The takeexample project in the TutorialHCBasics workspace shows how to use the take bits <- operator. The source code
DSM tutorials while (1) { par { /* * Increment up to 15, then wrap round to 0 */ Count++;
DSM tutorials while (1) { par { /* * Increment up to 15, then wrap round to 0 */ Count++;
DSM tutorials unsigned 4 Count1; unsigned 4 Count2; unsigned 4 Count3; signal <unsigned 4> CountSig; while (1) { /* * Increment up t
DSM tutorials BLOCK DIAGRAM 4.2.2 Seven-segment display hardware interface First define macro expressions for the pins which the seven-segment disp
DSM tutorials macro proc SevenSeg0WriteDigit (Value, DecimalPoint) { SevenSeg[0] = DecimalPoint @ TranslationROM0[Value]; } The two macros shown
DSM tutorials CREATING A NEW WORKSPACE Creating a new project Then, select the File>New menu again and create a new project in the workspace,
DSM tutorials Creating simulation and hardware configurations Now, select the Build>Configurations menu, select the Debug configuration, and clic
DSM tutorials Customizing the simulation configuration The two new configurations can now be customized for their particular targets. Select the Pro
DSM tutorials On the Preprocessor tab, add USE_SIM to the Preprocessor definitions box, as shown below. This definition is used to specify which PAL
PDK Tutorial Manual Assumptions & Omissions This manual assumes that you: • have used Handel-C or have the Handel-C Language Reference Manual •
DSM tutorials C:\program files\celoxica\pdk\software\lib\palsim.libThe Linker tab with all the libraries set up for simulation is show below. LIN
DSM tutorials As the RC200 is a hardware target, a device type must also be specified. Go to the Chip tab in Project Settings, make sure that Family
DSM tutorials PalSevenSegWriteDigit (PalSevenSegCT (0), (unsigned 4) 0xE, 0); PalSevenSegWriteShape (PalSevenSegCT (1), (unsigned 8) 0b11110110); Th
Tutorial: Handel-C and PSL basics 5 Tutorial: Handel-C and VGA graphics output The Handel-C and VGA graphics tutorial illustrates how to use Handel-
Tutorial: Handel-C and PSL basics macro expr White = 0xFFFFFF; macro expr Black = 0x000000; macro expr Red = 0xFF0000; macro expr Green = 0x00FF00
Tutorial: Handel-C and PSL basics To run the example yourself, open the TutorialVGA workspace (Start>Programs>Celoxica>Platform Developer&a
Tutorial: Handel-C and PSL basics number of pixels in the Y direction. This is necessary for the display output code shown to work correctly, as att
Tutorial: Handel-C and PSL basics static macro proc Sleep (Milliseconds) { #ifdef USE_SIM macro expr Cycles = (10000 * Milliseconds) / 1000; #el
Tutorial: Handel-C and PSL basics 5.3 Adding mouse input The GraphicsDemo3 project in the TutorialVGA workspace (Start>Programs>Celoxica>P
Tutorial: Handel-C and PSL basics while (1) { par { XPos = MouseX; YPos = MouseY; if (MouseL == 1) BoxC
PAL tutorial 1 PAL tutorial The PAL tutorial shows an experienced Handel-C programmer how to implement platform-independent hardware using the Hande
Tutorial: Handel-C and PSL basics The figure below shows the GraphicsDemo3 project running in simulation on the PalSim Virtual Platform. To run the
Tutorial: Handel-C and VGA graphics output 6 Tutorial: Handel-C code optimization The following examples illustrate different methods of optimizing
Tutorial: Handel-C and VGA graphics output signal unsigned 16 temp1, temp2; par { temp1 = b << c; temp2 = b * d; a = temp1 + temp2
Tutorial: Handel-C and VGA graphics output ram unsigned 8 Memory[4]; This will create a more efficient structure in hardware, but will now be limite
Tutorial: Handel-C and VGA graphics output 6.1.3 Macro procedures vs. functions The main difference between a macro proc and a function in Handel-C
Tutorial: Handel-C and VGA graphics output assignment to take a single clock cycle. The result is that for() loops have a single clock cycle rhead s
Tutorial: Handel-C and VGA graphics output static unsigned 1 Test = 1; unsigned 8 a; unsigned 32 b, c, d; while (Test == 1) { par {
Tutorial: Handel-C and VGA graphics output 6.2.4 Nested control Using nested if() statements, or long chains of if()...else() blocks can result in a
Tutorial: Handel-C code optimization 7 Tutorial: Handel-C advanced optimization The following examples illustrate advanced methods of optimizing Han
Tutorial: Handel-C code optimization The behaviour and timing of the code is as follows: • After the first clock cycle: • new values for the addit
PAL tutorial 5. Place and route the files (using Xilinx or Altera tools as appropriate). 6. Download the resulting .bit file onto the Spartan II F
Tutorial: Handel-C code optimization #define WIDTH 8 unsigned WIDTH sum[WIDTH]; unsigned WIDTH a[WIDTH]; unsigned WIDTH b[WIDTH]; while(1) { par
Tutorial: Handel-C code optimization struct _DivideStruct { unsigned 16 InputA; unsigned 16 InputB; unsigned 16 Result; }; typedef struc
Tutorial: Handel-C code optimization 7.3.2 Flash memory client-server example The operation of flash memory is more complicated than asynchronous RA
Tutorial: Handel-C code optimization /* * Erase data from the block in the Flash referenced by BlockNumber * Parameters: FlashPtr : input of
Tutorial: Handel-C code optimization DataBusConnects the server to the input expression of the flash data bus interface StatusBusConnects the server
Tutorial: Handel-C code optimization macro proc FlashRun (FlashPtr, ClockRate) { // Initialization sequence unsigned 3 Command; do { Flash
Tutorial: Handel-C code optimization macro proc FlashWriteWord (FlashPtr, Address, Data) { par { FlashPtr->APICom
Tutorial: Handel-C advanced optimization 8 Tutorial: Using the logic estimator The following examples illustrate the use of the DK Logic Estimator t
Tutorial: Handel-C advanced optimization 8.2 Using the logic estimator results The results from the logic estimator can help you to improve the spee
Tutorial: Handel-C advanced optimization It should appear as below: ESTIMATION SUMMARY FROM VERSION1 PROJECT The first section of the summary provi
PAL tutorial Getting compile-time information from the resource There are a number of API calls that allow you to get information from PAL resources
Tutorial: Handel-C advanced optimization 8.3 Reducing the logic delay If you build the code for the TutorialEstimator version1 project, open the sum
Tutorial: Handel-C advanced optimization do { par { C = A * B; D = A + B; } par { Output = C + D;
Tutorial: Handel-C advanced optimization directory. Open the file named Summary.html by double-clicking on it (this should load your computers defau
Tutorial: Handel-C advanced optimization Try modifying the code in the version2 project in the TutorialEstimator workspace to use this pipeline, reb
Tutorial: Handel-C advanced optimization If you open the summary.html page for the version2 project in the TutorialEstimator workspace (accessible f
Tutorial: Handel-C advanced optimization First, the while condition on line number 57 uses a "less than" < comparison, when in fact a &
Tutorial: Handel-C advanced optimization The version3 project in the TutorialEstimator workspace (accessible from Start>Programs>Celoxica>P
Tutorial: Handel-C advanced optimization One final change can be made to reduce the logic area further still, and it will have the side-effect of re
Tutorial: Handel-C advanced optimization As we are targetting a Xilinx Virtex-II device in this case, and the design contains a multiplier, the ALU
Tutorial: Handel-C advanced optimization You can see that with ALU mapping enabled there is another column in the area estimation, showing how many
Comentarios a estos manuales