习题7代码没输入完
This commit is contained in:
parent
4059b95aea
commit
bb4987f1cd
|
@ -0,0 +1 @@
|
|||
http://ewm.ptpress.com.cn:8085/preview?qrCode=qr2018001479&verified=true
|
|
@ -0,0 +1 @@
|
|||
http://ewm.ptpress.com.cn:8085/preview?qrCode=qr2018001477&verified=true
|
|
@ -0,0 +1 @@
|
|||
http://ewm.ptpress.com.cn:8085/preview?qrCode=qr2018001480&verified=true
|
|
@ -0,0 +1 @@
|
|||
http://ewm.ptpress.com.cn:8085/preview?qrCode=qr2018001485&verified=true
|
|
@ -0,0 +1,36 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int distance = 100;
|
||||
float power = 2.345f;
|
||||
double super_power = 56789.4532;
|
||||
char initial = 'A';
|
||||
char first_name[] = "Zed";
|
||||
char last_name = "Shaw";
|
||||
|
||||
printf("You are %d miles away.\n", distance);
|
||||
printf("You have %f levels of power.\n", power);
|
||||
printf("You have %f awesome super powers.\n");
|
||||
printf("I have an initial %c.\n", initial);
|
||||
printf("I have a first name %s.\n", first_name);
|
||||
printf("I have a last name %s.\n", last_name);
|
||||
printf("My whole name is %s %c. %s.\n", first_name, initial, last_name);
|
||||
|
||||
int bugs = 100;
|
||||
double bug_rate = 1.2;
|
||||
|
||||
printf("You have %d bugs at the imaginary rate of %f.\n", bugs, bug_rate);
|
||||
|
||||
long universe_of_defects = 1L * 1024L * 1024L * 1024L;
|
||||
|
||||
printf("The entire universe has %ld bugs.\n", universe_of_defects);
|
||||
|
||||
double expected_bugs = bugs * bug_rate;
|
||||
|
||||
printf("You are expected to have %f bugs.\n", expected_bugs);
|
||||
|
||||
double part_of_universe = expected_bugs / universe_of_defects;
|
||||
|
||||
printf("That is only a %e portion of the universe.\n", part_of_universe);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
######################################################################
|
||||
#
|
||||
# DESCRIPTION: Verilator Example: Small Makefile
|
||||
#
|
||||
# This calls the object directory makefile. That allows the objects to
|
||||
# be placed in the "current directory" which simplifies the Makefile.
|
||||
#
|
||||
# This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
# any use, without warranty, 2020 by Wilson Snyder.
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
######################################################################
|
||||
# Check for sanity to avoid later confusion
|
||||
|
||||
ifneq ($(words $(CURDIR)),1)
|
||||
$(error Unsupported: GNU Make cannot build in directories containing spaces, build elsewhere: '$(CURDIR)')
|
||||
endif
|
||||
|
||||
######################################################################
|
||||
|
||||
# This is intended to be a minimal example. Before copying this to start a
|
||||
# real project, it is better to start with a more complete example,
|
||||
# e.g. examples/make_tracing_c.
|
||||
|
||||
# If $VERILATOR_ROOT isn't in the environment, we assume it is part of a
|
||||
# package install, and verilator is in your path. Otherwise find the
|
||||
# binary relative to $VERILATOR_ROOT (such as when inside the git sources).
|
||||
ifeq ($(VERILATOR_ROOT),)
|
||||
VERILATOR = verilator
|
||||
else
|
||||
export VERILATOR_ROOT
|
||||
VERILATOR = $(VERILATOR_ROOT)/bin/verilator
|
||||
endif
|
||||
|
||||
default:
|
||||
@echo "-- Verilator hello-world simple example"
|
||||
@echo "-- VERILATE & BUILD --------"
|
||||
$(VERILATOR) -cc --exe --build -j top.v sim_main.cpp
|
||||
@echo "-- RUN ---------------------"
|
||||
obj_dir/Vtop
|
||||
@echo "-- DONE --------------------"
|
||||
@echo "Note: Once this example is understood, see examples/make_tracing_c."
|
||||
@echo "Note: See also https://verilator.org/guide/latest/examples.html"
|
||||
|
||||
######################################################################
|
||||
|
||||
maintainer-copy::
|
||||
clean mostlyclean distclean maintainer-clean::
|
||||
-rm -rf obj_dir *.log *.dmp *.vpd core
|
|
@ -0,0 +1,46 @@
|
|||
// DESCRIPTION: Verilator: Verilog example module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2017 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
//======================================================================
|
||||
|
||||
// Include common routines
|
||||
#include <verilated.h>
|
||||
|
||||
// Include model header, generated from Verilating "top.v"
|
||||
#include "Vtop.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
// See a similar example walkthrough in the verilator manpage.
|
||||
|
||||
// This is intended to be a minimal example. Before copying this to start a
|
||||
// real project, it is better to start with a more complete example,
|
||||
// e.g. examples/c_tracing.
|
||||
|
||||
// Construct a VerilatedContext to hold simulation time, etc.
|
||||
VerilatedContext* contextp = new VerilatedContext;
|
||||
|
||||
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
||||
// This needs to be called before you create any model
|
||||
contextp->commandArgs(argc, argv);
|
||||
|
||||
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
||||
Vtop* top = new Vtop{contextp};
|
||||
|
||||
// Simulate until $finish
|
||||
while (!contextp->gotFinish()) {
|
||||
|
||||
// Evaluate model
|
||||
top->eval();
|
||||
}
|
||||
|
||||
// Final model cleanup
|
||||
top->final();
|
||||
|
||||
// Destroy model
|
||||
delete top;
|
||||
|
||||
// Return good completion status
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// DESCRIPTION: Verilator: Verilog example module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2017 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
// See also https://verilator.org/guide/latest/examples.html"
|
||||
|
||||
module top;
|
||||
initial begin
|
||||
$display("Hello World!");
|
||||
$finish;
|
||||
end
|
||||
endmodule
|
Binary file not shown.
|
@ -0,0 +1,102 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Model implementation (design independent parts)
|
||||
|
||||
#include "Vour__pch.h"
|
||||
|
||||
//============================================================
|
||||
// Constructors
|
||||
|
||||
Vour::Vour(VerilatedContext* _vcontextp__, const char* _vcname__)
|
||||
: VerilatedModel{*_vcontextp__}
|
||||
, vlSymsp{new Vour__Syms(contextp(), _vcname__, this)}
|
||||
, rootp{&(vlSymsp->TOP)}
|
||||
{
|
||||
// Register model with the context
|
||||
contextp()->addModel(this);
|
||||
}
|
||||
|
||||
Vour::Vour(const char* _vcname__)
|
||||
: Vour(Verilated::threadContextp(), _vcname__)
|
||||
{
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Destructor
|
||||
|
||||
Vour::~Vour() {
|
||||
delete vlSymsp;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Evaluation function
|
||||
|
||||
#ifdef VL_DEBUG
|
||||
void Vour___024root___eval_debug_assertions(Vour___024root* vlSelf);
|
||||
#endif // VL_DEBUG
|
||||
void Vour___024root___eval_static(Vour___024root* vlSelf);
|
||||
void Vour___024root___eval_initial(Vour___024root* vlSelf);
|
||||
void Vour___024root___eval_settle(Vour___024root* vlSelf);
|
||||
void Vour___024root___eval(Vour___024root* vlSelf);
|
||||
|
||||
void Vour::eval_step() {
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+++++TOP Evaluate Vour::eval_step\n"); );
|
||||
#ifdef VL_DEBUG
|
||||
// Debug assertions
|
||||
Vour___024root___eval_debug_assertions(&(vlSymsp->TOP));
|
||||
#endif // VL_DEBUG
|
||||
vlSymsp->__Vm_deleter.deleteAll();
|
||||
if (VL_UNLIKELY(!vlSymsp->__Vm_didInit)) {
|
||||
vlSymsp->__Vm_didInit = true;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Initial\n"););
|
||||
Vour___024root___eval_static(&(vlSymsp->TOP));
|
||||
Vour___024root___eval_initial(&(vlSymsp->TOP));
|
||||
Vour___024root___eval_settle(&(vlSymsp->TOP));
|
||||
}
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Eval\n"););
|
||||
Vour___024root___eval(&(vlSymsp->TOP));
|
||||
// Evaluate cleanup
|
||||
Verilated::endOfEval(vlSymsp->__Vm_evalMsgQp);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Events and timing
|
||||
bool Vour::eventsPending() { return false; }
|
||||
|
||||
uint64_t Vour::nextTimeSlot() {
|
||||
VL_FATAL_MT(__FILE__, __LINE__, "", "%Error: No delays in the design");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Utilities
|
||||
|
||||
const char* Vour::name() const {
|
||||
return vlSymsp->name();
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Invoke final blocks
|
||||
|
||||
void Vour___024root___eval_final(Vour___024root* vlSelf);
|
||||
|
||||
VL_ATTR_COLD void Vour::final() {
|
||||
Vour___024root___eval_final(&(vlSymsp->TOP));
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Implementations of abstract methods from VerilatedModel
|
||||
|
||||
const char* Vour::hierName() const { return vlSymsp->name(); }
|
||||
const char* Vour::modelName() const { return "Vour"; }
|
||||
unsigned Vour::threads() const { return 1; }
|
||||
void Vour::prepareClone() const { contextp()->prepareClone(); }
|
||||
void Vour::atClone() const {
|
||||
contextp()->threadPoolpOnClone();
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Trace configuration
|
||||
|
||||
VL_ATTR_COLD void Vour::trace(VerilatedVcdC* tfp, int levels, int options) {
|
||||
vl_fatal(__FILE__, __LINE__, __FILE__,"'Vour::trace()' called on model that was Verilated without --trace option");
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Primary model header
|
||||
//
|
||||
// This header should be included by all source files instantiating the design.
|
||||
// The class here is then constructed to instantiate the design.
|
||||
// See the Verilator manual for examples.
|
||||
|
||||
#ifndef VERILATED_VOUR_H_
|
||||
#define VERILATED_VOUR_H_ // guard
|
||||
|
||||
#include "verilated.h"
|
||||
|
||||
class Vour__Syms;
|
||||
class Vour___024root;
|
||||
|
||||
// This class is the main interface to the Verilated model
|
||||
class alignas(VL_CACHE_LINE_BYTES) Vour VL_NOT_FINAL : public VerilatedModel {
|
||||
private:
|
||||
// Symbol table holding complete model state (owned by this class)
|
||||
Vour__Syms* const vlSymsp;
|
||||
|
||||
public:
|
||||
|
||||
// PORTS
|
||||
// The application code writes and reads these signals to
|
||||
// propagate new values into/out from the Verilated model.
|
||||
|
||||
// CELLS
|
||||
// Public to allow access to /* verilator public */ items.
|
||||
// Otherwise the application code can consider these internals.
|
||||
|
||||
// Root instance pointer to allow access to model internals,
|
||||
// including inlined /* verilator public_flat_* */ items.
|
||||
Vour___024root* const rootp;
|
||||
|
||||
// CONSTRUCTORS
|
||||
/// Construct the model; called by application code
|
||||
/// If contextp is null, then the model will use the default global context
|
||||
/// If name is "", then makes a wrapper with a
|
||||
/// single model invisible with respect to DPI scope names.
|
||||
explicit Vour(VerilatedContext* contextp, const char* name = "TOP");
|
||||
explicit Vour(const char* name = "TOP");
|
||||
/// Destroy the model; called (often implicitly) by application code
|
||||
virtual ~Vour();
|
||||
private:
|
||||
VL_UNCOPYABLE(Vour); ///< Copying not allowed
|
||||
|
||||
public:
|
||||
// API METHODS
|
||||
/// Evaluate the model. Application must call when inputs change.
|
||||
void eval() { eval_step(); }
|
||||
/// Evaluate when calling multiple units/models per time step.
|
||||
void eval_step();
|
||||
/// Evaluate at end of a timestep for tracing, when using eval_step().
|
||||
/// Application must call after all eval() and before time changes.
|
||||
void eval_end_step() {}
|
||||
/// Simulation complete, run final blocks. Application must call on completion.
|
||||
void final();
|
||||
/// Are there scheduled events to handle?
|
||||
bool eventsPending();
|
||||
/// Returns time at next time slot. Aborts if !eventsPending()
|
||||
uint64_t nextTimeSlot();
|
||||
/// Trace signals in the model; called by application code
|
||||
void trace(VerilatedVcdC* tfp, int levels, int options = 0);
|
||||
/// Retrieve name of this model instance (as passed to constructor).
|
||||
const char* name() const;
|
||||
|
||||
// Abstract methods from VerilatedModel
|
||||
const char* hierName() const override final;
|
||||
const char* modelName() const override final;
|
||||
unsigned threads() const override final;
|
||||
/// Prepare for cloning the model at the process level (e.g. fork in Linux)
|
||||
/// Release necessary resources. Called before cloning.
|
||||
void prepareClone() const;
|
||||
/// Re-init after cloning the model at the process level (e.g. fork in Linux)
|
||||
/// Re-allocate necessary resources. Called after cloning.
|
||||
void atClone() const;
|
||||
};
|
||||
|
||||
#endif // guard
|
|
@ -0,0 +1,68 @@
|
|||
# Verilated -*- Makefile -*-
|
||||
# DESCRIPTION: Verilator output: Makefile for building Verilated archive or executable
|
||||
#
|
||||
# Execute this makefile from the object directory:
|
||||
# make -f Vour.mk
|
||||
|
||||
default: Vour
|
||||
|
||||
### Constants...
|
||||
# Perl executable (from $PERL)
|
||||
PERL = perl
|
||||
# Path to Verilator kit (from $VERILATOR_ROOT)
|
||||
VERILATOR_ROOT = /usr/share/verilator
|
||||
# SystemC include directory with systemc.h (from $SYSTEMC_INCLUDE)
|
||||
SYSTEMC_INCLUDE ?=
|
||||
# SystemC library directory with libsystemc.a (from $SYSTEMC_LIBDIR)
|
||||
SYSTEMC_LIBDIR ?=
|
||||
|
||||
### Switches...
|
||||
# C++ code coverage 0/1 (from --prof-c)
|
||||
VM_PROFC = 0
|
||||
# SystemC output mode? 0/1 (from --sc)
|
||||
VM_SC = 0
|
||||
# Legacy or SystemC output mode? 0/1 (from --sc)
|
||||
VM_SP_OR_SC = $(VM_SC)
|
||||
# Deprecated
|
||||
VM_PCLI = 1
|
||||
# Deprecated: SystemC architecture to find link library path (from $SYSTEMC_ARCH)
|
||||
VM_SC_TARGET_ARCH = linux
|
||||
|
||||
### Vars...
|
||||
# Design prefix (from --prefix)
|
||||
VM_PREFIX = Vour
|
||||
# Module prefix (from --prefix)
|
||||
VM_MODPREFIX = Vour
|
||||
# User CFLAGS (from -CFLAGS on Verilator command line)
|
||||
VM_USER_CFLAGS = \
|
||||
|
||||
# User LDLIBS (from -LDFLAGS on Verilator command line)
|
||||
VM_USER_LDLIBS = \
|
||||
|
||||
# User .cpp files (from .cpp's on Verilator command line)
|
||||
VM_USER_CLASSES = \
|
||||
sim_main \
|
||||
|
||||
# User .cpp directories (from .cpp's on Verilator command line)
|
||||
VM_USER_DIR = \
|
||||
. \
|
||||
|
||||
|
||||
### Default rules...
|
||||
# Include list of all generated classes
|
||||
include Vour_classes.mk
|
||||
# Include global rules
|
||||
include $(VERILATOR_ROOT)/include/verilated.mk
|
||||
|
||||
### Executable rules... (from --exe)
|
||||
VPATH += $(VM_USER_DIR)
|
||||
|
||||
sim_main.o: sim_main.cpp
|
||||
$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o $@ $<
|
||||
|
||||
### Link rules... (from --exe)
|
||||
Vour: $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a $(VM_HIER_LIBS)
|
||||
$(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LIBS) $(SC_LIBS) -o $@
|
||||
|
||||
|
||||
# Verilated -*- Makefile -*-
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
// DESCRIPTION: Generated by verilator_includer via makefile
|
||||
#define VL_INCLUDE_OPT include
|
||||
#include "Vour.cpp"
|
||||
#include "Vour___024root__DepSet_hf7027e39__0.cpp"
|
||||
#include "Vour___024root__DepSet_h637983f1__0.cpp"
|
||||
#include "Vour___024root__Slow.cpp"
|
||||
#include "Vour___024root__DepSet_h637983f1__0__Slow.cpp"
|
||||
#include "Vour__Syms.cpp"
|
|
@ -0,0 +1,9 @@
|
|||
Vour__ALL.o: Vour__ALL.cpp Vour.cpp Vour__pch.h \
|
||||
/usr/share/verilator/include/verilated.h \
|
||||
/usr/share/verilator/include/verilatedos.h \
|
||||
/usr/share/verilator/include/verilated_config.h \
|
||||
/usr/share/verilator/include/verilated_types.h \
|
||||
/usr/share/verilator/include/verilated_funcs.h Vour__Syms.h Vour.h \
|
||||
Vour___024root.h Vour___024root__DepSet_hf7027e39__0.cpp \
|
||||
Vour___024root__DepSet_h637983f1__0.cpp Vour___024root__Slow.cpp \
|
||||
Vour___024root__DepSet_h637983f1__0__Slow.cpp Vour__Syms.cpp
|
Binary file not shown.
|
@ -0,0 +1,26 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Symbol table implementation internals
|
||||
|
||||
#include "Vour__pch.h"
|
||||
#include "Vour.h"
|
||||
#include "Vour___024root.h"
|
||||
|
||||
// FUNCTIONS
|
||||
Vour__Syms::~Vour__Syms()
|
||||
{
|
||||
}
|
||||
|
||||
Vour__Syms::Vour__Syms(VerilatedContext* contextp, const char* namep, Vour* modelp)
|
||||
: VerilatedSyms{contextp}
|
||||
// Setup internal state of the Syms class
|
||||
, __Vm_modelp{modelp}
|
||||
// Setup module instances
|
||||
, TOP{this, namep}
|
||||
{
|
||||
// Configure time unit / time precision
|
||||
_vm_contextp__->timeunit(-12);
|
||||
_vm_contextp__->timeprecision(-12);
|
||||
// Setup each module's pointers to their submodules
|
||||
// Setup each module's pointer back to symbol table (for public functions)
|
||||
TOP.__Vconfigure(true);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Symbol table internal header
|
||||
//
|
||||
// Internal details; most calling programs do not need this header,
|
||||
// unless using verilator public meta comments.
|
||||
|
||||
#ifndef VERILATED_VOUR__SYMS_H_
|
||||
#define VERILATED_VOUR__SYMS_H_ // guard
|
||||
|
||||
#include "verilated.h"
|
||||
|
||||
// INCLUDE MODEL CLASS
|
||||
|
||||
#include "Vour.h"
|
||||
|
||||
// INCLUDE MODULE CLASSES
|
||||
#include "Vour___024root.h"
|
||||
|
||||
// SYMS CLASS (contains all model state)
|
||||
class alignas(VL_CACHE_LINE_BYTES)Vour__Syms final : public VerilatedSyms {
|
||||
public:
|
||||
// INTERNAL STATE
|
||||
Vour* const __Vm_modelp;
|
||||
VlDeleter __Vm_deleter;
|
||||
bool __Vm_didInit = false;
|
||||
|
||||
// MODULE INSTANCE STATE
|
||||
Vour___024root TOP;
|
||||
|
||||
// CONSTRUCTORS
|
||||
Vour__Syms(VerilatedContext* contextp, const char* namep, Vour* modelp);
|
||||
~Vour__Syms();
|
||||
|
||||
// METHODS
|
||||
const char* name() { return TOP.name(); }
|
||||
};
|
||||
|
||||
#endif // guard
|
|
@ -0,0 +1,35 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Design internal header
|
||||
// See Vour.h for the primary calling header
|
||||
|
||||
#ifndef VERILATED_VOUR___024ROOT_H_
|
||||
#define VERILATED_VOUR___024ROOT_H_ // guard
|
||||
|
||||
#include "verilated.h"
|
||||
|
||||
|
||||
class Vour__Syms;
|
||||
|
||||
class alignas(VL_CACHE_LINE_BYTES) Vour___024root final : public VerilatedModule {
|
||||
public:
|
||||
|
||||
// DESIGN SPECIFIC STATE
|
||||
CData/*0:0*/ __VactContinue;
|
||||
IData/*31:0*/ __VactIterCount;
|
||||
VlTriggerVec<0> __VactTriggered;
|
||||
VlTriggerVec<0> __VnbaTriggered;
|
||||
|
||||
// INTERNAL VARIABLES
|
||||
Vour__Syms* const vlSymsp;
|
||||
|
||||
// CONSTRUCTORS
|
||||
Vour___024root(Vour__Syms* symsp, const char* v__name);
|
||||
~Vour___024root();
|
||||
VL_UNCOPYABLE(Vour___024root);
|
||||
|
||||
// INTERNAL METHODS
|
||||
void __Vconfigure(bool first);
|
||||
};
|
||||
|
||||
|
||||
#endif // guard
|
|
@ -0,0 +1,109 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Design implementation internals
|
||||
// See Vour.h for the primary calling header
|
||||
|
||||
#include "Vour__pch.h"
|
||||
#include "Vour___024root.h"
|
||||
|
||||
void Vour___024root___eval_act(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_act\n"); );
|
||||
}
|
||||
|
||||
void Vour___024root___eval_nba(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_nba\n"); );
|
||||
}
|
||||
|
||||
void Vour___024root___eval_triggers__act(Vour___024root* vlSelf);
|
||||
|
||||
bool Vour___024root___eval_phase__act(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_phase__act\n"); );
|
||||
// Init
|
||||
VlTriggerVec<0> __VpreTriggered;
|
||||
CData/*0:0*/ __VactExecute;
|
||||
// Body
|
||||
Vour___024root___eval_triggers__act(vlSelf);
|
||||
__VactExecute = vlSelf->__VactTriggered.any();
|
||||
if (__VactExecute) {
|
||||
__VpreTriggered.andNot(vlSelf->__VactTriggered, vlSelf->__VnbaTriggered);
|
||||
vlSelf->__VnbaTriggered.thisOr(vlSelf->__VactTriggered);
|
||||
Vour___024root___eval_act(vlSelf);
|
||||
}
|
||||
return (__VactExecute);
|
||||
}
|
||||
|
||||
bool Vour___024root___eval_phase__nba(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_phase__nba\n"); );
|
||||
// Init
|
||||
CData/*0:0*/ __VnbaExecute;
|
||||
// Body
|
||||
__VnbaExecute = vlSelf->__VnbaTriggered.any();
|
||||
if (__VnbaExecute) {
|
||||
Vour___024root___eval_nba(vlSelf);
|
||||
vlSelf->__VnbaTriggered.clear();
|
||||
}
|
||||
return (__VnbaExecute);
|
||||
}
|
||||
|
||||
#ifdef VL_DEBUG
|
||||
VL_ATTR_COLD void Vour___024root___dump_triggers__nba(Vour___024root* vlSelf);
|
||||
#endif // VL_DEBUG
|
||||
#ifdef VL_DEBUG
|
||||
VL_ATTR_COLD void Vour___024root___dump_triggers__act(Vour___024root* vlSelf);
|
||||
#endif // VL_DEBUG
|
||||
|
||||
void Vour___024root___eval(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval\n"); );
|
||||
// Init
|
||||
IData/*31:0*/ __VnbaIterCount;
|
||||
CData/*0:0*/ __VnbaContinue;
|
||||
// Body
|
||||
__VnbaIterCount = 0U;
|
||||
__VnbaContinue = 1U;
|
||||
while (__VnbaContinue) {
|
||||
if (VL_UNLIKELY((0x64U < __VnbaIterCount))) {
|
||||
#ifdef VL_DEBUG
|
||||
Vour___024root___dump_triggers__nba(vlSelf);
|
||||
#endif
|
||||
VL_FATAL_MT("our.v", 1, "", "NBA region did not converge.");
|
||||
}
|
||||
__VnbaIterCount = ((IData)(1U) + __VnbaIterCount);
|
||||
__VnbaContinue = 0U;
|
||||
vlSelf->__VactIterCount = 0U;
|
||||
vlSelf->__VactContinue = 1U;
|
||||
while (vlSelf->__VactContinue) {
|
||||
if (VL_UNLIKELY((0x64U < vlSelf->__VactIterCount))) {
|
||||
#ifdef VL_DEBUG
|
||||
Vour___024root___dump_triggers__act(vlSelf);
|
||||
#endif
|
||||
VL_FATAL_MT("our.v", 1, "", "Active region did not converge.");
|
||||
}
|
||||
vlSelf->__VactIterCount = ((IData)(1U)
|
||||
+ vlSelf->__VactIterCount);
|
||||
vlSelf->__VactContinue = 0U;
|
||||
if (Vour___024root___eval_phase__act(vlSelf)) {
|
||||
vlSelf->__VactContinue = 1U;
|
||||
}
|
||||
}
|
||||
if (Vour___024root___eval_phase__nba(vlSelf)) {
|
||||
__VnbaContinue = 1U;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VL_DEBUG
|
||||
void Vour___024root___eval_debug_assertions(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_debug_assertions\n"); );
|
||||
}
|
||||
#endif // VL_DEBUG
|
|
@ -0,0 +1,73 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Design implementation internals
|
||||
// See Vour.h for the primary calling header
|
||||
|
||||
#include "Vour__pch.h"
|
||||
#include "Vour___024root.h"
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___eval_static(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_static\n"); );
|
||||
}
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___eval_initial__TOP(Vour___024root* vlSelf);
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___eval_initial(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_initial\n"); );
|
||||
// Body
|
||||
Vour___024root___eval_initial__TOP(vlSelf);
|
||||
}
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___eval_initial__TOP(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_initial__TOP\n"); );
|
||||
// Body
|
||||
VL_WRITEF("Hello World\n");
|
||||
VL_FINISH_MT("our.v", 2, "");
|
||||
}
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___eval_final(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_final\n"); );
|
||||
}
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___eval_settle(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_settle\n"); );
|
||||
}
|
||||
|
||||
#ifdef VL_DEBUG
|
||||
VL_ATTR_COLD void Vour___024root___dump_triggers__act(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___dump_triggers__act\n"); );
|
||||
// Body
|
||||
if ((1U & (~ (IData)(vlSelf->__VactTriggered.any())))) {
|
||||
VL_DBG_MSGF(" No triggers active\n");
|
||||
}
|
||||
}
|
||||
#endif // VL_DEBUG
|
||||
|
||||
#ifdef VL_DEBUG
|
||||
VL_ATTR_COLD void Vour___024root___dump_triggers__nba(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___dump_triggers__nba\n"); );
|
||||
// Body
|
||||
if ((1U & (~ (IData)(vlSelf->__VnbaTriggered.any())))) {
|
||||
VL_DBG_MSGF(" No triggers active\n");
|
||||
}
|
||||
}
|
||||
#endif // VL_DEBUG
|
||||
|
||||
VL_ATTR_COLD void Vour___024root___ctor_var_reset(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___ctor_var_reset\n"); );
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Design implementation internals
|
||||
// See Vour.h for the primary calling header
|
||||
|
||||
#include "Vour__pch.h"
|
||||
#include "Vour__Syms.h"
|
||||
#include "Vour___024root.h"
|
||||
|
||||
#ifdef VL_DEBUG
|
||||
VL_ATTR_COLD void Vour___024root___dump_triggers__act(Vour___024root* vlSelf);
|
||||
#endif // VL_DEBUG
|
||||
|
||||
void Vour___024root___eval_triggers__act(Vour___024root* vlSelf) {
|
||||
if (false && vlSelf) {} // Prevent unused
|
||||
Vour__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp;
|
||||
VL_DEBUG_IF(VL_DBG_MSGF("+ Vour___024root___eval_triggers__act\n"); );
|
||||
// Body
|
||||
#ifdef VL_DEBUG
|
||||
if (VL_UNLIKELY(vlSymsp->_vm_contextp__->debug())) {
|
||||
Vour___024root___dump_triggers__act(vlSelf);
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Design implementation internals
|
||||
// See Vour.h for the primary calling header
|
||||
|
||||
#include "Vour__pch.h"
|
||||
#include "Vour__Syms.h"
|
||||
#include "Vour___024root.h"
|
||||
|
||||
void Vour___024root___ctor_var_reset(Vour___024root* vlSelf);
|
||||
|
||||
Vour___024root::Vour___024root(Vour__Syms* symsp, const char* v__name)
|
||||
: VerilatedModule{v__name}
|
||||
, vlSymsp{symsp}
|
||||
{
|
||||
// Reset structure values
|
||||
Vour___024root___ctor_var_reset(this);
|
||||
}
|
||||
|
||||
void Vour___024root::__Vconfigure(bool first) {
|
||||
if (false && first) {} // Prevent unused
|
||||
}
|
||||
|
||||
Vour___024root::~Vour___024root() {
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// Verilated -*- C++ -*-
|
||||
// DESCRIPTION: Verilator output: Precompiled header
|
||||
//
|
||||
// Internal details; most user sources do not need this header,
|
||||
// unless using verilator public meta comments.
|
||||
// Suggest use Vour.h instead.
|
||||
|
||||
|
||||
#ifndef VERILATED_VOUR__PCH_H_
|
||||
#define VERILATED_VOUR__PCH_H_ // guard
|
||||
|
||||
// GCC and Clang only will precompile headers (PCH) for the first header.
|
||||
// So, make sure this is the one and only PCH.
|
||||
// If multiple module's includes are needed, use individual includes.
|
||||
#ifdef VL_PCH_INCLUDED
|
||||
# error "Including multiple precompiled header files"
|
||||
#endif
|
||||
#define VL_PCH_INCLUDED
|
||||
|
||||
|
||||
#include "verilated.h"
|
||||
|
||||
#include "Vour__Syms.h"
|
||||
#include "Vour.h"
|
||||
|
||||
#endif // guard
|
|
@ -0,0 +1 @@
|
|||
obj_dir/Vour.cpp obj_dir/Vour.h obj_dir/Vour.mk obj_dir/Vour__Syms.cpp obj_dir/Vour__Syms.h obj_dir/Vour___024root.h obj_dir/Vour___024root__DepSet_h637983f1__0.cpp obj_dir/Vour___024root__DepSet_h637983f1__0__Slow.cpp obj_dir/Vour___024root__DepSet_hf7027e39__0.cpp obj_dir/Vour___024root__Slow.cpp obj_dir/Vour__pch.h obj_dir/Vour__ver.d obj_dir/Vour_classes.mk : /usr/bin/verilator_bin /usr/bin/verilator_bin /usr/share/verilator/include/verilated_std.sv our.v
|
|
@ -0,0 +1,19 @@
|
|||
# DESCRIPTION: Verilator output: Timestamp data for --skip-identical. Delete at will.
|
||||
C "--cc --exe --build -j 0 -Wall sim_main.cpp our.v"
|
||||
S 10993608 8164735 1742618344 434221218 1705136080 0 "/usr/bin/verilator_bin"
|
||||
S 4942 2103486 1742618344 444223527 1705136080 0 "/usr/share/verilator/include/verilated_std.sv"
|
||||
T 3171 5558938 1742619167 227086387 1742619167 227086387 "obj_dir/Vour.cpp"
|
||||
T 3104 5558937 1742619167 227086387 1742619167 227086387 "obj_dir/Vour.h"
|
||||
T 1817 5558949 1742619167 228086414 1742619167 228086414 "obj_dir/Vour.mk"
|
||||
T 737 5558932 1742619167 227086387 1742619167 227086387 "obj_dir/Vour__Syms.cpp"
|
||||
T 912 5558936 1742619167 227086387 1742619167 227086387 "obj_dir/Vour__Syms.h"
|
||||
T 799 5558941 1742619167 227086387 1742619167 227086387 "obj_dir/Vour___024root.h"
|
||||
T 3991 5558945 1742619167 227086387 1742619167 227086387 "obj_dir/Vour___024root__DepSet_h637983f1__0.cpp"
|
||||
T 2941 5558946 1742619167 227086387 1742619167 227086387 "obj_dir/Vour___024root__DepSet_h637983f1__0__Slow.cpp"
|
||||
T 749 5558944 1742619167 227086387 1742619167 227086387 "obj_dir/Vour___024root__DepSet_hf7027e39__0.cpp"
|
||||
T 613 5558943 1742619167 227086387 1742619167 227086387 "obj_dir/Vour___024root__Slow.cpp"
|
||||
T 684 5558939 1742619167 227086387 1742619167 227086387 "obj_dir/Vour__pch.h"
|
||||
T 466 5558951 1742619167 228086414 1742619167 228086414 "obj_dir/Vour__ver.d"
|
||||
T 0 0 1742619167 228086414 1742619167 228086414 "obj_dir/Vour__verFiles.dat"
|
||||
T 1576 5558948 1742619167 228086414 1742619167 228086414 "obj_dir/Vour_classes.mk"
|
||||
S 78 5558589 1742618705 972724650 1742618705 972724650 "our.v"
|
|
@ -0,0 +1,51 @@
|
|||
# Verilated -*- Makefile -*-
|
||||
# DESCRIPTION: Verilator output: Make include file with class lists
|
||||
#
|
||||
# This file lists generated Verilated files, for including in higher level makefiles.
|
||||
# See Vour.mk for the caller.
|
||||
|
||||
### Switches...
|
||||
# C11 constructs required? 0/1 (always on now)
|
||||
VM_C11 = 1
|
||||
# Timing enabled? 0/1
|
||||
VM_TIMING = 0
|
||||
# Coverage output mode? 0/1 (from --coverage)
|
||||
VM_COVERAGE = 0
|
||||
# Parallel builds? 0/1 (from --output-split)
|
||||
VM_PARALLEL_BUILDS = 0
|
||||
# Tracing output mode? 0/1 (from --trace/--trace-fst)
|
||||
VM_TRACE = 0
|
||||
# Tracing output mode in VCD format? 0/1 (from --trace)
|
||||
VM_TRACE_VCD = 0
|
||||
# Tracing output mode in FST format? 0/1 (from --trace-fst)
|
||||
VM_TRACE_FST = 0
|
||||
|
||||
### Object file lists...
|
||||
# Generated module classes, fast-path, compile with highest optimization
|
||||
VM_CLASSES_FAST += \
|
||||
Vour \
|
||||
Vour___024root__DepSet_hf7027e39__0 \
|
||||
Vour___024root__DepSet_h637983f1__0 \
|
||||
|
||||
# Generated module classes, non-fast-path, compile with low/medium optimization
|
||||
VM_CLASSES_SLOW += \
|
||||
Vour___024root__Slow \
|
||||
Vour___024root__DepSet_h637983f1__0__Slow \
|
||||
|
||||
# Generated support classes, fast-path, compile with highest optimization
|
||||
VM_SUPPORT_FAST += \
|
||||
|
||||
# Generated support classes, non-fast-path, compile with low/medium optimization
|
||||
VM_SUPPORT_SLOW += \
|
||||
Vour__Syms \
|
||||
|
||||
# Global classes, need linked once per executable, fast-path, compile with highest optimization
|
||||
VM_GLOBAL_FAST += \
|
||||
verilated \
|
||||
verilated_threads \
|
||||
|
||||
# Global classes, need linked once per executable, non-fast-path, compile with low/medium optimization
|
||||
VM_GLOBAL_SLOW += \
|
||||
|
||||
|
||||
# Verilated -*- Makefile -*-
|
|
@ -0,0 +1,6 @@
|
|||
sim_main.o: ../sim_main.cpp Vour.h \
|
||||
/usr/share/verilator/include/verilated.h \
|
||||
/usr/share/verilator/include/verilatedos.h \
|
||||
/usr/share/verilator/include/verilated_config.h \
|
||||
/usr/share/verilator/include/verilated_types.h \
|
||||
/usr/share/verilator/include/verilated_funcs.h
|
Binary file not shown.
|
@ -0,0 +1,11 @@
|
|||
verilated.o: /usr/share/verilator/include/verilated.cpp \
|
||||
/usr/share/verilator/include/verilated_config.h \
|
||||
/usr/share/verilator/include/verilatedos.h \
|
||||
/usr/share/verilator/include/verilated_imp.h \
|
||||
/usr/share/verilator/include/verilated.h \
|
||||
/usr/share/verilator/include/verilated_types.h \
|
||||
/usr/share/verilator/include/verilated_funcs.h \
|
||||
/usr/share/verilator/include/verilated_syms.h \
|
||||
/usr/share/verilator/include/verilated_sym_props.h \
|
||||
/usr/share/verilator/include/verilated_threads.h \
|
||||
/usr/share/verilator/include/verilated_trace.h
|
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
verilated_threads.o: /usr/share/verilator/include/verilated_threads.cpp \
|
||||
/usr/share/verilator/include/verilatedos.h \
|
||||
/usr/share/verilator/include/verilated_threads.h \
|
||||
/usr/share/verilator/include/verilated.h \
|
||||
/usr/share/verilator/include/verilated_config.h \
|
||||
/usr/share/verilator/include/verilated_types.h \
|
||||
/usr/share/verilator/include/verilated_funcs.h
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
module our;
|
||||
initial begin $display("Hello World"); $finish; end
|
||||
endmodule
|
|
@ -0,0 +1,20 @@
|
|||
#include "Vour.h"
|
||||
#include "verilated.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
VerilatedContext* contextp = new VerilatedContext;
|
||||
|
||||
contextp->commandArgs(argc, argv);
|
||||
|
||||
Vour* top = new Vour{contextp};
|
||||
|
||||
while (!contextp->gotFinish())
|
||||
{
|
||||
top->eval();
|
||||
}
|
||||
delete top;
|
||||
delete contextp;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue