Problem with TestBuilder Compile

R

Rajat

Guest
Hi All,
When I compile the following code using the testBuilder.sh script -


+++++++++++++Start ++++++++++++++++++++++++++++++++++++++++++
include "TestBuilder.h"
#include "readWriteTvmT.h"
#include <cstdlib>
#include <iostream.h>
#include <time.h>


//Stuff for Random Number

void init_mm( );
int number_range( int from, int to );
int number_mm( void );
static int rgiState[2+55]; // leave this alone




void tbvMain()
{


readWriteTvmT& tvm = (readWriteTvmT&)
*tbvTvmT::getTvmByInstanceNameP("u_readWriteTvmT");



//Initialize transactor drive signals
tvm.startup_message.run();
tvm.do_resetinit.run();

//Wait for power up initialization to complete
for(int jj=0; jj< 1000; jj++){
tbvWaitCycle(tvm.clk, tbvThreadT::pOSEDGE);
}

//Initialize Random Number Generator
init_mm();

//Open a given row
tbvSmartIntT row_open;

row_open = 0;
tvm.write_cacheline.run( &row_open );

//After opening the row start random writes
row_open = 1;

for(int mm=0; mm<1000;mm++){
tvm.write_cacheline.run( &row_open );
int rand_num = number_range(1,10);
for(int pp=0; pp < rand_num; pp++){
tbvWaitCycle(tvm.clk, tbvThreadT::pOSEDGE);
}
}

for(int jj=0; jj< 1000; jj++){
tbvWaitCycle(tvm.clk, tbvThreadT::pOSEDGE);
}


tbvExit();
}






//**************************************
// Name: A better Random Number Generator
// Description:This is a better random number generator than comes
// standard. It's from a very good book on algoritms. You should read
// it
// By: Andy Williams
//
//
// Inputs:None
//
// Returns:None
//
//Assumes:None
//
//Side Effects:None
//This code is copyrighted and has limited warranties.
//Please see http://www.Planet-Source-Code.com/xq/ASP/\
//txtCodeId.239/lngWId.3/qx/vb/scripts/ShowCode.htm
//for details.
//**************************************



/***************************************************************
* Andy William's Random Number Generator
***************************************************************

int number_mm( void )
{
int *piState;
int iState1;
int iState2;
int iRand;
piState = &rgiState[2];
iState1 = piState[-2];
iState2 = piState[-1];
iRand = ( piState[iState1] + piState[iState2] )
& ( ( 1 << 30 ) - 1 );
piState[iState1] = iRand;
if ( ++iState1 == 55 )
iState1 = 0;
if ( ++iState2 == 55 )
iState2 = 0;
piState[-2] = iState1;
piState[-1] = iState2;
return iRand >> 6;
}

/***************************************************************
* Generate a random number.
***************************************************************/
int number_range( int from, int to )
{
int power;
int number;
if ( ( to = to - from + 1 ) <= 1 )
return from;
for ( power = 2; power < to; power <<= 1 )
;
while ( ( number = number_mm( ) & ( power - 1 ) ) >= to )
;
return from + number;
}


/***************************************************************
* This is the Mitchell-Moore algorithm from Knuth Volume II.
***************************************************************/


void init_mm( )
{
int *piState;
int iState;
piState = &rgiState[2];
piState[-2] = 55 - 55;
piState[-1] = 55 - 24;
piState[0] = ( (int) time( NULL ) ) & ( ( 1 << 30 ) - 1 );
piState[1] = 1;
for ( iState = 2; iState < 55; iState++ )


{
piState[iState] = ( piState[iState-1] + piState[iState-2] )
& ( ( 1 << 30 ) - 1 );
}
return;
}

/***************************************************************
* Needed by TestBuilder
***************************************************************/
tbvTvmTypeT tbvTvmTypes[] = {
{"readWriteTvmT", readWriteTvmT::create, 0},
{0,0,0}
};
+++++++++++++++++++++++++End++++++++++++++++++++++++++++++++



I get the following runtime error (NC Verilog) -

Initiating Write Operation...
FLAGS: DATA_FULL = 0
FLAGS: ATTRB_FULL = 0
/usr/engineering/TestBuilder-01.30-s008/bin/ncsimC: error while loading
shared libraries: ./libtbvTestBench.so: undefined symbol: number_mm__Fv
ncverilog: *E,SIMERR: Error during Simulation (status 127), exiting.
### testBuilder.sh: Error: NCV-[SIMFAIL] ###
Simulation failed with ncverilog
###



Can anyone help. Os is RHAT 7.1


Thanks,

Raj
 
Hi all,
Never mind ... Found the typo !!! Sorry for the bad post.

-Rajat
 

Welcome to EDABoard.com

Sponsor

Back
Top