Skip to content

Commit 7c0f8f5

Browse files
committed
add first case
0 parents  commit 7c0f8f5

File tree

8 files changed

+621208
-0
lines changed

8 files changed

+621208
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
VERILATOR_ROOT := /usr/share/verilator
2+
CXX := clang++
3+
CFLAGS_WNO := -Wno-bool-operation -Wno-c++11-narrowing -Wno-constant-logical-operand -Wno-non-pod-varargs -Wno-parentheses-equality -Wno-shadow -Wno-sign-compare -Wno-tautological-bitwise-compare -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable
4+
CFLAGS_INC := -I$(VERILATOR_ROOT)/include -I$(VERILATOR_ROOT)/include/vltstd -I.
5+
CFLAGS := -O3 -faligned-new -fbracket-depth=4096 -fcf-protection=none -Qunused-arguments --std=c++17 -fprofile-generate -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=0 -DVERILATOR -DNUM_CORES=1 -DVERILATOR_4_210 -DEMU_THREAD=8 -fcolor-diagnostics $(CFLAGS_WNO) $(CFLAGS_INC)
6+
7+
VSimTop___024root__DepSet_hd5918264__148.o: VSimTop___024root__DepSet_hd5918264__148.cpp
8+
$(CXX) $(CFLAGS) -c -o $@ $<
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// Verilated -*- C++ -*-
2+
// DESCRIPTION: Verilator output: Primary model header
3+
//
4+
// This header should be included by all source files instantiating the design.
5+
// The class here is then constructed to instantiate the design.
6+
// See the Verilator manual for examples.
7+
8+
#ifndef VERILATED_VSIMTOP_H_
9+
#define VERILATED_VSIMTOP_H_ // guard
10+
11+
#include "verilated.h"
12+
#include "verilated_threads.h"
13+
#include "svdpi.h"
14+
15+
class VSimTop__Syms;
16+
class VSimTop___024root;
17+
class VSimTop___024unit;
18+
19+
20+
// This class is the main interface to the Verilated model
21+
class alignas(VL_CACHE_LINE_BYTES) VSimTop VL_NOT_FINAL : public VerilatedModel {
22+
private:
23+
// Symbol table holding complete model state (owned by this class)
24+
VSimTop__Syms* const vlSymsp;
25+
26+
public:
27+
28+
// CONSTEXPR CAPABILITIES
29+
// Verilated with --trace?
30+
static constexpr bool traceCapable = false;
31+
32+
// PORTS
33+
// The application code writes and reads these signals to
34+
// propagate new values into/out from the Verilated model.
35+
VL_IN8(&difftest_uart_in_ch,7,0);
36+
VL_OUT8(&difftest_uart_out_valid,0,0);
37+
VL_OUT8(&difftest_uart_out_ch,7,0);
38+
VL_OUT8(&difftest_uart_in_valid,0,0);
39+
VL_IN8(&reset,0,0);
40+
VL_IN8(&clock,0,0);
41+
VL_IN8(&difftest_perfCtrl_dump,0,0);
42+
VL_IN64(&difftest_logCtrl_begin,63,0);
43+
VL_IN64(&difftest_logCtrl_end,63,0);
44+
VL_IN8(&difftest_perfCtrl_clean,0,0);
45+
VL_OUT64(&difftest_step,63,0);
46+
VL_IN64(&difftest_logCtrl_level,63,0);
47+
48+
// CELLS
49+
// Public to allow access to /* verilator public */ items.
50+
// Otherwise the application code can consider these internals.
51+
VSimTop___024unit* const __PVT____024unit;
52+
53+
// Root instance pointer to allow access to model internals,
54+
// including inlined /* verilator public_flat_* */ items.
55+
VSimTop___024root* const rootp;
56+
57+
// CONSTRUCTORS
58+
/// Construct the model; called by application code
59+
/// If contextp is null, then the model will use the default global context
60+
/// If name is "", then makes a wrapper with a
61+
/// single model invisible with respect to DPI scope names.
62+
explicit VSimTop(VerilatedContext* contextp, const char* name = "TOP");
63+
explicit VSimTop(const char* name = "TOP");
64+
/// Destroy the model; called (often implicitly) by application code
65+
virtual ~VSimTop();
66+
private:
67+
VL_UNCOPYABLE(VSimTop); ///< Copying not allowed
68+
69+
public:
70+
// API METHODS
71+
/// Evaluate the model. Application must call when inputs change.
72+
void eval() { eval_step(); }
73+
/// Evaluate when calling multiple units/models per time step.
74+
void eval_step();
75+
/// Evaluate at end of a timestep for tracing, when using eval_step().
76+
/// Application must call after all eval() and before time changes.
77+
void eval_end_step() {}
78+
/// Simulation complete, run final blocks. Application must call on completion.
79+
void final();
80+
/// Are there scheduled events to handle?
81+
bool eventsPending();
82+
/// Returns time at next time slot. Aborts if !eventsPending()
83+
uint64_t nextTimeSlot();
84+
/// Trace signals in the model; called by application code
85+
void trace(VerilatedTraceBaseC* tfp, int levels, int options = 0) { contextp()->trace(tfp, levels, options); }
86+
/// Retrieve name of this model instance (as passed to constructor).
87+
const char* name() const;
88+
89+
// Abstract methods from VerilatedModel
90+
const char* hierName() const override final;
91+
const char* modelName() const override final;
92+
unsigned threads() const override final;
93+
/// Prepare for cloning the model at the process level (e.g. fork in Linux)
94+
/// Release necessary resources. Called before cloning.
95+
void prepareClone() const;
96+
/// Re-init after cloning the model at the process level (e.g. fork in Linux)
97+
/// Re-allocate necessary resources. Called after cloning.
98+
void atClone() const;
99+
private:
100+
// Internal functions - trace registration
101+
void traceBaseModel(VerilatedTraceBaseC* tfp, int levels, int options);
102+
};
103+
104+
#endif // guard

0 commit comments

Comments
 (0)