Skip to content

Commit

Permalink
fixup! [#68174] Improve initialization of the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JanOlencki committed Jan 22, 2025
1 parent 3d9bf3d commit a508874
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions samples/apb3uart/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void eval() {
uart->eval();
}

UART* initAgent() {
UART *initAgent() {
// These need static lifetime because we assign them to global pointers.
// By having the initialization here we guarantee that any static initialization
// from other compilation units (e. g. Verilator) is already done.
Expand Down Expand Up @@ -76,7 +76,7 @@ void initBus(RenodeAgent *agent)
agent->addBus(bus);
}

RenodeAgent* Init() {
RenodeAgent *Init() {
uart = initAgent();
uart->connectNative();
initBus(uart);
Expand Down
6 changes: 3 additions & 3 deletions samples/cpu_ibex/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ void evaluateModel()
ibex->evaluateModel();
}

CpuAgent* initAgent()
CpuAgent *initAgent()
{
Verilated::commandArgs(0, (const char **)nullptr);
CpuAgent* agent = new CpuAgent();
return agent;
}

void initBus(CpuAgent* agent)
void initBus(CpuAgent *agent)
{
WishboneInitiator<uint32_t, uint32_t> *instructionFetchBus = new WishboneInitiator<uint32_t, uint32_t>();
WishboneInitiator<uint32_t, uint32_t> *loadStoreBus = new WishboneInitiator<uint32_t, uint32_t>();
Expand All @@ -49,7 +49,7 @@ void initBus(CpuAgent* agent)
loadStoreBus->evaluateModel = evaluateModel;
}

RenodeAgent* Init() {
RenodeAgent *Init() {
agent = initAgent();
agent->connectNative();
initBus(agent);
Expand Down
2 changes: 1 addition & 1 deletion samples/fastvdma/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void initAgent(RenodeAgent *agent)
agent->registerInterrupt(&top->io_irq_readerDone, 0);
}

RenodeAgent* Init() {
RenodeAgent *Init() {
fastvdma->connectNative();
initAgent(fastvdma);
return fastvdma;
Expand Down
2 changes: 1 addition & 1 deletion samples/fpga_isp/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void initAgent(RenodeAgent *agent) {
#endif
}

RenodeAgent* Init() {
RenodeAgent *Init() {
isp->connectNative();
initAgent(isp);
return isp;
Expand Down
4 changes: 2 additions & 2 deletions samples/liteuart/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void eval() {
uart->eval();
}

UART* initAgent() {
UART *initAgent() {
const int litex_rxtx_reg = 0x800;
return new UART(&top->serial_tx, &top->serial_rx, prescaler, litex_rxtx_reg, &top->irq_uart0);
}
Expand Down Expand Up @@ -69,7 +69,7 @@ void initBus(RenodeAgent *agent)
agent->addBus(bus);
}

RenodeAgent* Init() {
RenodeAgent *Init() {
uart = initAgent();
uart->connectNative();
initBus(uart);
Expand Down
2 changes: 1 addition & 1 deletion samples/ram/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void initAgent(RenodeAgent *agent)
agent->addBus(bus);
}

RenodeAgent* Init() {
RenodeAgent *Init() {
axi_ram->connectNative();
initAgent(axi_ram);
return axi_ram;
Expand Down
4 changes: 2 additions & 2 deletions samples/uartlite/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void eval() {
}

RenodeAgent *initAgent() {
RenodeAgent * agent = new UART(&top->txd, &top->rxd, prescaler);
RenodeAgent *agent = new UART(&top->txd, &top->rxd, prescaler);
AxiLite* bus = new AxiLite();

//=================================================
Expand Down Expand Up @@ -71,7 +71,7 @@ RenodeAgent *initAgent() {
return agent;
}

RenodeAgent* Init() {
RenodeAgent *Init() {
RenodeAgent *agent = initAgent();
agent->connectNative();
return agent;
Expand Down
2 changes: 1 addition & 1 deletion samples/uartlite_extended/sim_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void initBus(RenodeAgent *agent) {
agent->addBus(bus);
}

RenodeAgent* Init() {
RenodeAgent *Init() {
RenodeAgent *agent = initAgent();
agent->connectNative();
initBus(agent);
Expand Down

0 comments on commit a508874

Please sign in to comment.