text
stringlengths
41
20k
//-----Function definitions for classes os, os_taski and os_sem--- //-----You must modify this file as indicated by TODO comments---- //-----You should reuse code from Programming Assignment 3-------- //-----as indicated by the REUSE comments------------------------- //-----Note that new code must be written for os_se...
//--------Thread function definitions----------------------------- //-----You must modify this file as indicated by TODO comments---- //must include to use the systemc library #include "systemc.h" #include "sysc/kernel/sc_dynamic_processes.h" #include "CPU.h" #include "Block.h" #include "ReadBmp_aux.h" // The main th...
/* Problem 1 Testbench */ #include<systemc.h> #include<sd.cpp> SC_MODULE(sequenceDetectorTB) { sc_signal<bool> clock , reset , clear , input , output , state; void clockSignal(); void resetSignal(); void clearSignal(); void inputSignal(); sequenceDetector* sd; SC_CTOR(sequenceDetectorTB) { sd = n...
/** * Murac Auxilliary Architecture integration framework * Author: Brandon Hamilton <brandon.hamilton@gmail.com> */ #include <systemc.h> #include <dlfcn.h> #include <fcntl.h> #include <sys/mman.h> #include "muracAA.hpp" typedef int (*murac_init_func)(BusInterface*); typedef int (*murac_exec_func)(unsigned long i...
#include <systemc.h> #include "HammingRegister.h" #include "testbench.h" #include "SYSTEM.h" SYSTEMH *sysh=NULL; int sc_main(int argc, char *argv[]) { cout << " The Simulation Started"<< endl; sysh=new SYSTEMH("sysh"); sc_start(); //start the simulation cout <<" The Simulation Ended "<<endl; return 0; ...
/* * SysTop testbench for Harvard cs148/248 only * */ #include "SysTop.h" #include <systemc.h> #include <mc_scverify.h> #include <nvhls_int.h> #include <vector> #define NVHLS_VERIFY_BLOCKS (SysTop) #include <nvhls_verify.h> using namespace::std; #include <testbench/nvhls_rand.h> // W/I/O dimensions const stat...
//-----Function definitions for classes os, os_taski and os_sem--- //-----You must modify this file as indicated by TODO comments---- //-----You should reuse code from Programming Assignment 3-------- //-----as indicated by the REUSE comments------------------------- //-----Note that new code must be written for os_se...
#include <systemc.h> #include "SYSTEM.h"
#include <crave/SystemC.hpp> #include <crave/ConstrainedRandom.hpp> #include <systemc.h> #include <boost/timer.hpp> using crave::rand_obj; using crave::randv; using sc_dt::sc_bv; using sc_dt::sc_uint; /** * ALU: * complete enumerated there are: * ADD 0x0: 136 * SUB 0x1: 136 * MUL 0x2: 76 * DIV 0x3: 240 * vali...
/** * Author: Anubhav Tomar * * Gaze Behavior Monitoring System Testbench **/ #include<systemc.h> #include<SERVER.h> #include<MOBILE.h> // template < > class _gazeMonitor : public sc_module { public: /*Signals for Module Interconnections*/ sc_signal<bool> _clock; sc_signal<sc_uint<1> > _inM1_1 , _inM2_...
/* * @ASCK */ #include <systemc.h> SC_MODULE (ALU) { sc_in <sc_int<8>> in1; // A sc_in <sc_int<8>> in2; // B sc_in <bool> c; // Carry Out // in this project, this signal is always 1 // ALUOP // has 5 bits by merging: opselect (4bits) and first LSB bit of opcode (1bit) sc_in <sc_uint<5>...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/***************************************************************************** main.cpp -- The testbench *****************************************************************************/ #include <systemc.h> #include "NoximMain.h" #include "NoximNoC.h" #include "NoximGlobalStats.h" #include "NoximCmdLineParser.h" #i...
#include "systemc.h" #include "rfsm.h" void notify_ev(sc_out<bool> &s, const char* name) { s.write(1); #ifdef SYSTEMC_TRACE_EVENTS cout << "rsfm.cpp: notify_ev(" << name << ") @ t=" << sc_time_stamp() << " (delta=" << sc_delta_count() << ")" << endl; #endif wait(SYSTEMC_EVENT_DURATION,SYSTEMC_EVENT_DURATION_UNIT...
/******************************************************************************* * ledcmod.cpp -- Copyright 2020 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Implements a SystemC module for the ESP32 PWM LEDC module. *************...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* * @ASCK */ #include <systemc.h> SC_MODULE (ID) { sc_in_clk clk; sc_in <sc_int<8>> prev_A; sc_in <sc_int<8>> prev_B; sc_in <sc_int<13>> prev_Imm; sc_in <sc_uint<3>> prev_Sa; sc_in <sc_uint<5>> prev_AluOp; sc_in <bool> prev_r; sc_in <bool> prev_w; sc_in <bool> prev_AluM...
/******************************************************************************* * task.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This file reimplements the freertos tasks to get them to compile under the * ...
#include <systemc.h> class sc_clockx : sc_module, sc_interface { public: sc_event edge; sc_event change; bool val; bool _val; int delta; private: int period; SC_HAS_PROCESS(sc_clockx); void run(void) { int tmp = period/2; edge.notify(SC_ZERO_TIME); change.notify(S...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
#include <memory> #include <systemc.h> #include "sc_top.h" int sc_main(int argc, char* argv[]) { if (false && argc && argv) {} Verilated::debug(0); Verilated::randReset(2); Verilated::commandArgs(argc, argv); ios::sync_with_stdio(); const std::unique_ptr<sc_top> u_sc_top{new sc_top("sc_top...
/******************************************************************************* * panic.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This file replaces the run time error functions from the ESP32 with * equi...
/******************************************************************************* * uart.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Model for a UART. *******************************************************...
#ifndef PACKET_GENERATOR_TLM_CPP #define PACKET_GENERATOR_TLM_CPP #include <systemc.h> using namespace sc_core; using namespace sc_dt; using namespace std; #include <tlm.h> #include <tlm_utils/simple_initiator_socket.h> #include <tlm_utils/simple_target_socket.h> #include <tlm_utils/peq_with_cb_and_phase.h> #include ...
#include <systemc.h> #include "Memory.h" using namespace std; void Memory::execute() { // Initialize memory to some predefined contents. for (int i=0; i<MEM_SIZE; i++) _data[i] = i + 0xff000; port_Stall = true; for (;;) { wait(); int addr = port_Addr % MEM_SIZE; if (p...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
#ifndef IMG_TARGET_CPP #define IMG_TARGET_CPP #include <systemc.h> using namespace sc_core; using namespace sc_dt; using namespace std; #include <tlm.h> #include <tlm_utils/simple_initiator_socket.h> #include <tlm_utils/simple_target_socket.h> #include <tlm_utils/peq_with_cb_and_phase.h> //For an internal response p...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
//--------Thread function definitions----------------------------- //-----You must modify this file as indicated by TODO comments---- //must include to use the systemc library #include "systemc.h" #include "JPEG.h" #include "Block.h" #include "ReadBmp_aux.h" void Read_Module::Read_thread(){ cout << sc_time_stamp() <...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/** #define meta ... prInt32f("%s\n", meta); **/ /* All rights reserved to Alireza Poshtkohi (c) 1999-2023. Email: arp@poshtkohi.info Website: http://www.poshtkohi.info */ #include <systemc.h> #include <iostream> #include "des.h" #include "tb.h" #include <vector> #include <iostream> using namespace std;...
// ************************************************************************************** // User-defined memory manager, which maintains a pool of transactions // From TLM Duolos tutorials // ************************************************************************************** #ifndef TRANSACTION_MEMORY_MANAGER_CPP #...
/* * Created on: 21. jun. 2019 * Author: Jonathan Horsted Schougaard */ #ifdef HW_COSIM //#define __GMP_WITHIN_CONFIGURE #endif #define DEBUG_SYSTEMC #define SC_INCLUDE_FX #include "hwcore/tb/cnn/tb_pe.hpp" #include <systemc.h> unsigned errors = 0; const char simulation_name[] = "tb_pe"; int sc_main(int argc...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
//----------------------------------------------------- #include "systemc.h" SC_MODULE (ram) { sc_inout<sc_uint<32> > data; sc_in<sc_uint<32> > address; //-----------Internal variables------------------- sc_uint <32> mem[1024]; sc_event rd_t, wr_t; // Constructor for memory //SC_CTOR(ram) { ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/****************************************************** * This is the main file for the mips1 ArchC model * * This file is automatically generated by ArchC * * WITHOUT WARRANTY OF ANY KIND, either express * * or implied. * * For more information on ArchC, please...
#include <systemc.h> //here we create a module called hello_world SC_MODULE(hello_world) { private int meaning_of_life; // easter egg //SC_CTOR -- systemC constructor SC_CTOR(hello_world) { meaning_of_life=42; } void say_hello() { cout << "Hello Systemc-2.3.1!\n"; } void open_magic_box() { ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
#include <systemc.h> #include "Producer.h" #include "Consumer.h" int sc_main(int argc, char* argv[]) { // generating the sc_signal sc_signal<int> data_sig; // generating the modules Producer prod1("Producer1"); Consumer cons1("Consumer1"); // connecting modules via signals prod1.data(data_sig); cons1.data(da...
/** * Author: Anubhav Tomar * * Controller Definition **/ #include<systemc.h> template <class _addrSize , class _dataSize> class _controllerBlock : public sc_module { public: // Inputs sc_in<bool> _clock; sc_in<sc_uint<16> > _instructionIn; sc_in<_dataSize> _operand1In; sc_in<_dataSize> _operand2I...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* * @ASCK */ #include <systemc.h> SC_MODULE (ID) { sc_in_clk clk; sc_in <sc_int<8>> prev_A; sc_in <sc_int<8>> prev_B; sc_in <sc_int<13>> prev_Imm; sc_in <sc_uint<3>> prev_Sa; sc_in <sc_uint<5>> prev_AluOp; sc_in <bool> prev_r; sc_in <bool> prev_w; sc_in <bool> prev_AluM...
/******************************************************************************** * University of L'Aquila - HEPSYCODE Source Code License * * * * ...
// Copyright 2020 Glenn Ramalho - RFIDo Design // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/******************************************************************************** * University of L'Aquila - HEPSYCODE Source Code License * * * * ...
/******************************************************************************* * clkgen.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Emulates the clocks on the ESP32. ***************************************...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* * Created on: 21. jun. 2019 * Author: Jonathan Horsted Schougaard */ #ifdef HW_COSIM //#define __GMP_WITHIN_CONFIGURE #endif #define DEBUG_SYSTEMC #define SC_INCLUDE_FX #include "hwcore/tb/cnn/tb_pe.hpp" #include <systemc.h> unsigned errors = 0; const char simulation_name[] = "tb_pe"; int sc_main(int argc...
#include <systemc.h> class sc_clockx : sc_module, sc_interface { public: sc_event edge; sc_event change; bool val; bool _val; int delta; private: int period; SC_HAS_PROCESS(sc_clockx); void run(void) { int tmp = period/2; edge.notify(SC_ZERO_TIME); change.notify(S...
//--------Function definitions for classes os and os_task--------- //-----You must modify this file as indicated by TODO comments---- #include "systemc.h" #include "os.h" using namespace std; // implementation of os_task methods //placeholder constructor since we have a pool os_task::os_task() { } os_task::~os_tas...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
// ================================================================ // NVDLA Open Source Project // // Copyright(c) 2016 - 2017 NVIDIA Corporation. Licensed under the // NVDLA Open Hardware License; Check "LICENSE" which comes with // this distribution for more information. // =======================================...
//***** Convert FP17 to FP32 ****** ac_channel<vFp17Type> chn_a; chn_a.write(icvt_data_out[i]); HLS_fp17_to_fp32(chn_a, fp17tofp32_out[i]); icvt_data_out_fp32[i] = fp17tofp32_out[i].read(); ac_channel<vFp32Type> chn_b, chn_c; chn_b.write(icvt_data_out_fp32[i]...
// ================================================================ // NVDLA Open Source Project // // Copyright(c) 2016 - 2017 NVIDIA Corporation. Licensed under the // NVDLA Open Hardware License; Check "LICENSE" which comes with // this distribution for more information. // =======================================...
//***** Convert FP17 to FP32 ****** ac_channel<vFp17Type> chn_a; chn_a.write(icvt_data_out[i]); HLS_fp17_to_fp32(chn_a, fp17tofp32_out[i]); icvt_data_out_fp32[i] = fp17tofp32_out[i].read(); ac_channel<vFp32Type> chn_b, chn_c; chn_b.write(icvt_data_out_fp32[i]...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** The following code is derived, directly or indirectly, from the SystemC source code Copyright (c) 1996-2014 by all Contributors. All Rights reserved. The contents of this file are subject to the restrictions and limitations set f...
#ifndef SOBEL_EDGE_DETECTOR_TLM_CPP #define SOBEL_EDGE_DETECTOR_TLM_CPP #include <systemc.h> using namespace sc_core; using namespace sc_dt; using namespace std; #include <tlm.h> #include "sobel_edge_detector_tlm.hpp" #include "address_map.hpp" #include "common_func.hpp" void sobel_edge_detector_tlm::do_when_read_tr...
/* * @ASCK */ #include <systemc.h> SC_MODULE (ID) { sc_in_clk clk; sc_in <sc_int<8>> prev_A; sc_in <sc_int<8>> prev_B; sc_in <sc_int<13>> prev_Imm; sc_in <sc_uint<3>> prev_Sa; sc_in <sc_uint<5>> prev_AluOp; sc_in <bool> prev_r; sc_in <bool> prev_w; sc_in <bool> prev_AluM...
#include <systemc.h> class sc_clockx : sc_module, sc_interface { public: sc_event edge; sc_event change; bool val; bool _val; int delta; private: int period; SC_HAS_PROCESS(sc_clockx); void run(void) { int tmp = period/2; edge.notify(SC_ZERO_TIME); change.notify(S...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/************************************************************************** * * * Catapult(R) MatchLib Toolkit Example Design Library * * * * Software Ver...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/******************************************************************************* * dns.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a stubfile that sets several defines for a simplified version of * t...
/******************************************************************************* * task.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This file reimplements the freertos tasks to get them to compile under the * ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...