Commit e49ce3cf authored by Ricardo Soares Ribolli's avatar Ricardo Soares Ribolli
Browse files

Avancement du TP

parent bd52f091
bus.o: bus.cpp bus.h ensitlm.h
bus.h:
ensitlm.h:
This diff is collapsed.
This diff is collapsed.
File added
This diff is collapsed.
File added
#include "generator.h"
using namespace std;
void generator::thread(void) {
ensitlm::data_t val = 1;
ensitlm::addr_t addr = 0x10000000;
for(int i = 0; i < 10; i++) {
val = i;
socket.write(addr, val);
addr++;
}
}
generator::generator(sc_core::sc_module_name name) : sc_core::sc_module(name) {
SC_THREAD(thread);
}
This diff is collapsed.
#include "ensitlm.h"
#include "bus.h"
struct generator : sc_core::sc_module {
ensitlm::initiator_socket<generator> socket;
void thread(void);
SC_CTOR(generator);
};
#include "memory.h"
using namespace std;
tlm::tlm_response_status memory::write(const ensitlm::addr_t &a,
const ensitlm::data_t &d) {
cout << "Message reçu: " << d << " from: " << endl;
}
tlm::tlm_response_status memory::read(const ensitlm::addr_t &a,
/* */ ensitlm::data_t &d) {
SC_REPORT_ERROR("TLM", "non implémenté");
abort();
}
This diff is collapsed.
#include "ensitlm.h"
struct memory : sc_core::sc_module {
ensitlm::target_socket<memory> socket;
tlm::tlm_response_status write(const ensitlm::addr_t &a,
const ensitlm::data_t &d);
tlm::tlm_response_status read(const ensitlm::addr_t &a,
/* */ ensitlm::data_t &d);
SC_CTOR(memory) { /* */ }
};
File added
#include "ensitlm.h"
#include "generator.h"
#include "bus.h"
#include "memory.h"
int sc_main(int argc, char **argv){
(void)argc;
(void)argv;
/* Creation of a Generator and a Bus */
generator g1("Generator1");
Bus b("Bus");
memory m("Memory");
/* Connexion between generation and bus */
g1.socket.bind(b.target);
/* Connexion between bus and target */
b.initiator.bind(m.socket);
/* Mapping memory addresses between [0x10000000, 0x100000FF] */
b.map(m.socket, 0x10000000, 0x100);
/* Start the simulation */
sc_core::sc_start();
return 0;
}
sc_main.o: sc_main.cpp generator.h ../ensitlm/ensitlm.h ../ensitlm/bus.h \
../ensitlm/ensitlm.h memory.h
generator.h:
../ensitlm/ensitlm.h:
../ensitlm/bus.h:
../ensitlm/ensitlm.h:
memory.h:
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment