#include "ca model h" #include "ru common h"


Download 12.71 Kb.
Sana05.01.2022
Hajmi12.71 Kb.
#231761
Bog'liq
2 5267023858006755898


#include "ca_model.h"

#include "ru_common.h"

#include "print_log.h"

#include "ca_program.h"


class ADDER : public CA_MODEL {

public:


pINPUT A1;

pINPUT A2;

pOUTPUT Z;

ADDER(const CA_MODEL* parent, const std::string &name, const PrintOptions& printOptions = 0) :

CA_MODEL(parent, name, "ADDER", printOptions)

{}
void init(int w) {

INPUT(A1, w);

INPUT(A2, w);

OUTPUT(Z, w);
Z = E(A1) + E(A2);

}

};


int main() {

PrintOptions po(mask(optPrintIO), PrintIOFormat::TXT);

ADDER a(0, "a", po);

a.init(64);


//CA_Program prog;

//prog.init(&a);


a.genVerilog();

a.genVerilogTestbench();


a.reset();

int flags = CA_MODEL::FLAG_DEBUG | CA_MODEL::FLAG_PRINT | CA_MODEL::FLAG_GEN_VERILOG;

a.initPrintData(flags);

a.nextClock(flags);



a.nextClock(flags);
//a.Test(1,0,32);
return 0;

}
Download 12.71 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling