I am trying to get a handle on HDL to C++ conversions and have hit a bit of a snag. The conversion using Verilator on Ubuntu is easy enough but one data type is annoying me.
The top code in the hierarchy is...
#include <iostream>
#include "VDorQ24Syms.h"
#include "VDorQ24.h"
using namespace std;
// FUNCTIONS
VDorQ24Syms::VDorQ24Syms(VDorQ24* topp, const char* namep)
// Setup locals
: vm_namep(namep)
, vm_activity(false)
, vm_didInit(false)
// Setup submodule names
{
// Pointer to top level
tOPp = topp;
// Setup each module's pointers to their submodules
// Setup each module's pointer back to symbol table (for public functions)
tOPp->Vconfigure(this, true);
// Setup scope names
}
Passing data to the function
VDorQ24Syms::VDorQ24Syms(VDorQ24* topp, const char* namep)
is what I'm not getting. The second parameter is easy to understand. The first, not so much.
By this I mean, what is the compiler expecting me to pass? Which data type?
I want to pass data like so...
VDorQ24* randomCharacter;
if (VDorQ24Syms(randomCharacter, szAscii) == /*condition*/)
{
return /*value*/;
}
But 'randomCharacter' is uninitialized.
VDorQ24* randomCharacter = /*How do I initialize this?*/;