mirror of
https://github.com/Minres/RISCV-VP.git
synced 2025-12-17 17:01:35 +00:00
fixes namespaces to match directory hierarchy
This commit is contained in:
@@ -85,7 +85,7 @@ int sc_main(int argc, char* argv[]) {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// instantiate top level
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
auto i_system = scc::make_unique<tgc_vp::tb>("tb");
|
||||
auto i_system = scc::make_unique<vp::tb>("tb");
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// add non-implemented 'enableTracing' properties
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019 -2021 MINRES Technolgies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <systemc>
|
||||
|
||||
namespace tgc_vp {
|
||||
|
||||
class rst_gen : public sc_core::sc_module {
|
||||
SC_HAS_PROCESS(rst_gen);
|
||||
|
||||
public:
|
||||
rst_gen(sc_core::sc_module_name const& nm) { SC_THREAD(run); }
|
||||
sc_core::sc_out<bool> rst_n{"rst_n"};
|
||||
|
||||
private:
|
||||
void run() {
|
||||
rst_n.write(false);
|
||||
wait(100_ns);
|
||||
rst_n.write(true);
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace tgc_vp */
|
||||
@@ -10,7 +10,8 @@
|
||||
#include <minres/uart.h>
|
||||
#include <scc/utilities.h>
|
||||
|
||||
namespace tgc_vp {
|
||||
namespace vp {
|
||||
|
||||
using namespace sc_core;
|
||||
using namespace vpvper::minres;
|
||||
|
||||
@@ -89,4 +90,4 @@ void system::gen_reset() {
|
||||
rst_s = 1;
|
||||
}
|
||||
|
||||
} // namespace tgc_vp
|
||||
} // namespace vp
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _PLATFORM_H_
|
||||
#define _PLATFORM_H_
|
||||
#ifndef SRC_VP_SYSTEM_H_
|
||||
#define SRC_VP_SYSTEM_H_
|
||||
|
||||
#include <minres/irq.h>
|
||||
#include <minres/timer.h>
|
||||
#include <cci_configuration>
|
||||
#include <minres/aclint.h>
|
||||
#include <minres/gpio.h>
|
||||
#include <minres/irq.h>
|
||||
#include <minres/qspi.h>
|
||||
#include <minres/timer.h>
|
||||
#include <minres/uart.h>
|
||||
#include <scc/memory.h>
|
||||
#include <scc/router.h>
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <sysc/utils/sc_vector.h>
|
||||
#include <tlm/scc/tlm_signal_sockets.h>
|
||||
|
||||
namespace tgc_vp {
|
||||
namespace vp {
|
||||
|
||||
class system : public sc_core::sc_module {
|
||||
public:
|
||||
@@ -70,6 +70,6 @@ private:
|
||||
#include "../vp/gen/PipelinedMemoryBusToApbBridge.h"
|
||||
};
|
||||
|
||||
} // namespace tgc_vp
|
||||
} // namespace vp
|
||||
|
||||
#endif /* _PLATFORM_H_ */
|
||||
#endif /* SRC_VP_SYSTEM_H_ */
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include "tb.h"
|
||||
#include <sysc/kernel/sc_time.h>
|
||||
|
||||
namespace tgc_vp {
|
||||
namespace vp {
|
||||
|
||||
SC_HAS_PROCESS(tb);
|
||||
tb::tb(const sc_core::sc_module_name& nm)
|
||||
: sc_core::sc_module(nm) {
|
||||
top.erst_n(rst_n);
|
||||
rst_gen.rst_n(rst_n);
|
||||
rst_gen.rst_o(rst_n);
|
||||
top.pins_o(pins_o);
|
||||
top.pins_i(pins_i);
|
||||
top.pins_oe_o(pins_oe_o);
|
||||
@@ -25,5 +25,6 @@ tb::tb(const sc_core::sc_module_name& nm)
|
||||
spi(0)(qspi_mem.spi_t);
|
||||
top.clk_i(clk_i);
|
||||
clk_i = 10_ns;
|
||||
rst_gen.active_level = false;
|
||||
}
|
||||
} // namespace tgc_vp
|
||||
} // namespace vp
|
||||
|
||||
12
src/vp/tb.h
12
src/vp/tb.h
@@ -7,19 +7,19 @@
|
||||
#ifndef SRC_VP_TB_H_
|
||||
#define SRC_VP_TB_H_
|
||||
|
||||
#include "system.h"
|
||||
#include <generic/rst_gen.h>
|
||||
#include <generic/spi_mem.h>
|
||||
#include <generic/terminal.h>
|
||||
#include <systemc>
|
||||
|
||||
#include "rst_gen.h"
|
||||
#include "system.h"
|
||||
namespace tgc_vp {
|
||||
namespace vp {
|
||||
|
||||
class tb : public sc_core::sc_module {
|
||||
public:
|
||||
tb(sc_core::sc_module_name const& nm);
|
||||
tgc_vp::system top{"top"};
|
||||
tgc_vp::rst_gen rst_gen{"rst_gen"};
|
||||
vp::system top{"top"};
|
||||
vpvper::generic::rst_gen rst_gen{"rst_gen"};
|
||||
sc_core::sc_signal<bool> rst_n{"rst_n"};
|
||||
sc_core::sc_vector<sc_core::sc_signal<bool>> pins_o{"pins_o", 32};
|
||||
sc_core::sc_vector<sc_core::sc_signal<bool>> pins_oe_o{"pins_oe_o", 32};
|
||||
@@ -33,6 +33,6 @@ public:
|
||||
sc_core::sc_signal<sc_core::sc_time> clk_i{"clk_i"};
|
||||
};
|
||||
|
||||
} /* namespace tgc_vp */
|
||||
} // namespace vp
|
||||
|
||||
#endif /* SRC_VP_TB_H_ */
|
||||
|
||||
Reference in New Issue
Block a user