Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with IP connected via FSL to POwer PC

Status
Not open for further replies.

saqaw

Junior Member level 3
Joined
Oct 2, 2006
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,536
I created an IP using the create and import IP wizard and connecte dit to the FSL bus. The FSL bus was connected to power PC 405using the PLB2FSL bridge. To begin if every thing is fine I included the default example in the drivers folder of my IP. The name of the IP is adder_1. Every works fine , except that when i download the bitstream I get the following error



ERROR:Xflow - Program ngdbuild returned error code 2. Aborting flow execution...

make: *** [__xps/system_routed] Error 1

Can anyone help please why am i getting this error?

Following is the .c code and .h code



//////////////////////////////////////////////////////////////////////////////
// Filename: J:\RADAR\Projects\EDK\Test_plb2fsl\drivers/adder_1_v1_00_a/examples/adder_1_v2_1_0_app.c
// Version: 1.00.a
// Description: adder_1 (new FSL core) Driver Example File
// Date: Sat Nov 07 17:12:33 2009 (by Create and Import Peripheral Wizard)
//////////////////////////////////////////////////////////////////////////////

#include "adder_1.h"

#include "xparameters.h"

/*
* Follwing is an example driver function
* that is called in the main function.
*
* This example driver writes all the data in the input arguments
* into the input FSL bus through blocking writes. FSL peripheral will
* automatically read from the FSL bus. Once all the inputs
* have been written, the output from the FSL peripheral is read
* into output arguments through blocking reads.
*
* CAUTION:
*
* The sequence of writes and reads in this function should be consistent
* with the sequence of reads or writes in the HDL implementation of this
* coprocessor.
*
*/
// Instance name specific MACROs. Defined for each instance of the peripheral.
#define XPAR_FSL_ADDER_1_0_OUTPUT_SLOT_ID 0
#define XPAR_FSL_ADDER_1_0_INPUT_SLOT_ID 0

#define WRITE_ADDER_1_0(val) write_into_fsl(val, XPAR_FSL_ADDER_1_0_INPUT_SLOT_ID)
#define READ_ADDER_1_0(val) read_from_fsl(val, XPAR_FSL_ADDER_1_0_OUTPUT_SLOT_ID)

void adder_1_app(
unsigned int* input_0, /* Array size = 2 */
unsigned int* output_0 /* Array size = 1 */
)
{
int i;

//Start writing into the FSL bus
for (i=0; i<2; i++)
{
WRITE_ADDER_1_0(input_0);
}

//Start reading from the FSL bus
for (i=0; i<1; i++)
{
READ_ADDER_1_0(output_0);
}
}

main()
{
unsigned int input_0[2];
unsigned int output_0[1];


#ifdef __PPC__
// Enable APU for PowerPC.
unsigned int msr_i;
msr_i = mfmsr();
msr_i = (msr_i | XREG_MSR_APU_AVAILABLE | XREG_MSR_APU_ENABLE) & ~XREG_MSR_USER_MODE;
mtmsr(msr_i);
#endif

//Initialize your input data over here:
input_0[0] = 12345;
input_0[1] = 24690;

//Call the macro with instance specific slot IDs
adder_1(
XPAR_FSL_ADDER_1_0_INPUT_SLOT_ID,
XPAR_FSL_ADDER_1_0_OUTPUT_SLOT_ID,
input_0,
output_0
);

// You can also define your own function to access the peripheral
// Here you are calling the example function defined above
// Note the slot ID can not be passed over as function parameters
adder_1_app(
input_0,
output_0
);
xil_printf("GpioInputExample PASSED. Read data:0x%X\r\n", output_0[0]);

}

//////////////////////////////////////////////////////////////////////////////
// Filename: J:\RADAR\Projects\EDK\Test_plb2fsl\drivers/adder_1_v1_00_a/src/adder_1.h
// Version: 1.00.a
// Description: adder_1 (new FSL core) Driver Header File
// Date: Sat Nov 07 17:12:33 2009 (by Create and Import Peripheral Wizard)
//////////////////////////////////////////////////////////////////////////////

#ifndef ADDER_1_H
#define ADDER_1_H

#include "xstatus.h"

#include "fsl.h"
#define write_into_fsl(val, id) putfsl(val, id)
#define read_from_fsl(val, id) getfsl(val, id)

/*
* A macro for accessing FSL peripheral.
*
* This example driver writes all the data in the input arguments
* into the input FSL bus through blocking writes. FSL peripheral will
* automatically read from the FSL bus. Once all the inputs
* have been written, the output from the FSL peripheral is read
* into output arguments through blocking reads.
*
* Arguments:
* input_slot_id
* Compile time constant indicating FSL slot from
* which coprocessor read the input data. Defined in
* xparameters.h .
* output_slot_id
* Compile time constant indicating FSL slot into
* which the coprocessor write output data. Defined in
* xparameters.h .
* input_0 An array of unsigned integers. Array size is 2
* output_0 An array of unsigned integers. Array size is 1
*
* Caveats:
* The output_slot_id and input_slot_id arguments must be
* constants available at compile time. Do not pass
* variables for these arguments.
*
* Since this is a macro, using it too many times will
* increase the size of your application. In such cases,
* or when this macro is too simplistic for your
* application you may want to create your own instance
* specific driver function (not a macro) using the
* macros defined in this file and the slot
* identifiers defined in xparameters.h . Please see the
* example code (adder_1_app.c) for details.
*/

#define adder_1(\
input_slot_id,\
output_slot_id,\
input_0, \
output_0 \
)\
{\
int i;\
\
for (i=0; i<2; i++)\
{\
write_into_fsl(input_0, input_slot_id);\
}\
\
for (i=0; i<1; i++)\
{\
read_from_fsl(output_0, output_slot_id);\
}\
}

XStatus ADDER_1_SelfTest();

#endif





I haven't written any code for the plb2fsl bridge.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top