text
stringlengths
0
252
out->put(tr);
}
}
SC_CTOR(refmod_low): in("in"), out("out") { SC_THREAD(p); }
};
#include "refmod.cpp"
#include "refmod_low.cpp"
int sc_main(int argc, char* argv[]) {
refmod refmod_i("refmod_i");
refmod_low refmod_low_i("refmod_low_i");
uvmc_connect(refmod_i.in, "refmod_i.in");
uvmc_connect(refmod_low_i.in, "refmod_low_i.in");
uvmc_connect(refmod_i.out, "refmod_i.out");
uvmc_connect(refmod_low_i.out, "refmod_low_i.out");
sc_start();
return(0);
}
#ifndef KAHN_PROCESS_H
#define KAHN_PROCESS_H
/*
* kahn_process.h -- Base SystemC module for modeling applications using KPN
*
* System-Level Architecture and Modeling Lab
* Department of Electrical and Computer Engineering
* The University of Texas at Austin
*
* Author: Kamyar Mirzazad Barijough ([email protected])
*/
#include <systemc.h>
class kahn_process : public sc_module
{
public:
SC_HAS_PROCESS(kahn_process);
kahn_process(sc_module_name name) : sc_module(name)
{
iter = 0;
SC_THREAD(main);
}
void main() { while(true) {process(); iter++;} }
protected:
int iter = 0;
virtual void process() = 0;
};
#endif
#include <systemc.h>
template <class T> SC_MODULE (driver){
// Modulo de acionamento
sc_fifo_out <T> acionamento;
// Constante para acionamento
T cte;
// Funcionamento do driver
void drive(){
int contador = 0;
// Geracao de 0s para o acionamento do sistema
while(contador < 3){
acionamento.write(cte);
cout << "Gerou um " << cte << endl;
contador++;
}
}
// Utilizando construtor de C++
SC_HAS_PROCESS(driver);
driver (sc_module_name n, const T& c):
sc_module(n), cte(c){
SC_THREAD (drive);
}
};
#include "sistema.cpp"
int sc_main (int arc, char * argv[]){
// Instanciacao do sistema, definindo o tipo da matriz e do vetor
sistema <int> sistema_instance("sistema_instance");