text
stringlengths
41
20k
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** 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...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
#include <systemc.h> #include "main.h" /********************** * Function: setup() * * Main setup. Does nothing. Used mainly for compatabvility with the SystemC * model. */ void setup() { } /********************** * Function: loop() * * Calls the firmware. Then it stops simulations. */ void loop() { app_m...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** 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...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* ============================================================================ Name : displayYUV.c Author : mpelcat & kdesnos & jheulot Modified by : jserot (for use in the HoCL framework) Version : Copyright : CECILL-C Description : Displaying YUV frames one next to another in a row ================...
// BEGIN engine.cpp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // $Copyright: (c)2003-2006 Eklectically, Inc. $ // $License: May be used under the same terms as SystemC library. $ #include <systemc.h> #include <iomanip> //-------------------------------------------------------------------- // This S...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/** * Author: Anubhav Tomar * * Robot Navigation Testbench **/ #include<systemc.h> #include<SERVER.h> #include<ROBOT.h> #include<ENVIRONMENT.h> // template < > class _robotNavigation : public sc_module { public: /*Signals for Module Interconnections*/ // FIFO sc_fifo<int> _serverToRobot1 , _envToRobot...
/***************************************************************************** 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...
/* * @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...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** 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...
/****************************************************************************** * * * Copyright (C) 2022 MachineWare GmbH * * All Rights Reserved * ...
/* * Copyright (C) 2020 GreenWaves Technologies, SAS, ETH Zurich and * University of Bologna * * 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.apac...
:string &s, char delimiter) { std::vector<std::string> tokens; std::string token; std::istringstream tokenStream(s); while (std::getline(tokenStream, token, delimiter)) { tokens.push_back(token); } return tokens; } vp::config *vp::config::create_config(jsmntok_t *tokens, int *_size)...
(auto& x: this->get_childs()) { x->dump_traces_recursive(file); } } vp::component *vp::__gv_create(std::string config_path, struct gv_conf *gv_conf) { setenv("PULP_CONFIG_FILE", config_path.c_str(), 1); js::config *js_config = js::import_config_from_file(config_path); if (js_config == NUL...
/************************************************************************** * * * Catapult(R) Machine Learning Reference Design Library * * * * Software Ver...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
//**************************************************************************************** // MIT License //**************************************************************************************** // Copyright (c) 2012-2020 University of Bremen, Germany. // Copyright (c) 2015-2020 DFKI GmbH Bremen, Germany. // Cop...
//-----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...
#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> #include "common_func.hpp" #...
/******************************************************************************* * esp_wifi.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This file ports the esp_wifi functions for the ESP32 to the ESPMOD SystemC...
@param primary store current primary channel * @param[out] second store current second channel * * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_INVALID_ARG: invalid argument */ esp_err_t esp_wifi_get_channel(uint8_t *primary,...
IFI_IF_STA or WIFI_IF_AP. If the ifx is wrong, the API returns ESP_ERR_WIFI_IF. * @param buffer raw ieee80211 buffer * @param len the length of raw buffer, the len must be <= 1500 Bytes and >= 24 Bytes * @param en_sys_seq indicate whether use the internal sequence number. If en_sys_seq is false, 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 RGB2GRAY_TLM_CPP #define RGB2GRAY_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 "rgb2gray_tlm.hp...
/******************************************************************************* * tb_gpio.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Testbench for the GPIO models. ***************************************...
/* * @ASCK */ #include <systemc.h> SC_MODULE (IR) { sc_in <sc_uint<14>> addr; sc_out <sc_uint<20>> inst; /* ** module global variables */ sc_uint<20> mem[819]; // 819 rows and 819*20=16380 bits = (16KB - 4bits) ~= 16KB int instNum = 50; sc_uint<20> instruction[50] = { //...
//----------------------------------------------------- // This is my second Systemc Example // Design Name : first_counter // File Name : first_counter.cpp // Function : This is a 4 bit up-counter with // Synchronous active high reset and // with active high enable signal //--------------------------------------------...
/******************************************************************************* * pcf8574.cpp -- Copyright 2020 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a crude model for the PN532 with firmware v1.6. It will work fo...
// Shows the non-blocking transport interface with the generic payload and sockets // Shows nb_transport being called on the forward and backward paths // No support for temporal decoupling // No support for DMI or debug transport interfaces #include <systemc.h> using namespace sc_core; us...
#include <top.h> #include "systemc.h" int sc_main(int argc, char* argv[]){ sc_time clkprd(10, SC_NS); sc_time clkdly(0, SC_NS); sc_clock clk("clk", clkprd, 0.5, clkdly, true); // sc_signal<bool> reset; top *t; t = new top("top"); t->clk(clk); sc_start(5000, SC_NS); return(0); }
/***************************************************************************** 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...
#include "PluginFactory.h" #include "PrintITL/PrintITL.h" #include "PrintAML/PrintAML.h" #include "PrintSkeleton/PrintSkeleton.h" #include "PrintDot/PrintDotSimple.h" #include "PrintDot/PrintDotFull.h" #include "PrintDot/PrintDotStates.h" #include "PrintSystemC/PrintSystemC.h" #include "PrintSVA/PrintSVA.h" #include "P...
/******************************************************************************* * ledcmod.cpp -- Copyright 2020 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Implements a SystemC module for the ESP32 PWM LEDC module. *************...
/******************************************************************************* * TestSerial.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Generic Serial Class for communicating with a set of SystemC ports. * ...
/* * @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...
/******************************************************************************** * University of L'Aquila - HEPSYCODE Source Code License * * * * ...
---------------------- //// Run the index-th ANN k time on random input and return the number of error ////----------------------------------------------------------------------------- //int annTest(int index, int k) //{ // int x0; int x1; int y; // double x[2]; // double xor_ex; // int error = 0; // // if ( annCheck(i...
#include <string> #include <algorithm> #include <sstream> #include <vector> #include <systemc.h> #include "sc_qt_adaptor.h" #include "sc_config.h" #include "sc_run.h" #include "sc_debug_object.h" void scQtAdaptor::trace_module (sc_module *module) { auto children = module->get_child_objects(); sc_object * 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...
/** * 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...
/////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2017 Cadence Design Systems, Inc. All rights reserved worldwide. // // The code contained herein is the proprietary and confidential information // of Cadence or its licensors, and is supplied subject to a previously // ...
/* Problem 3 Testbench */ #include<systemc.h> #include<comm.cpp> SC_MODULE(communicationInterfaceTB) { sc_signal<sc_uint<12> > inData; sc_signal<bool> clock , reset , clear; sc_signal<sc_uint<4> > payloadOut; sc_signal<sc_uint<8> > countOut , errorOut; void clockSignal(); void clearSignal(); void resetSignal...
#include <string> #include "systemc.h" #include "system.h" #include "sc_trace.hpp" #include "noc_tile.h" // comparison counters uint32_t n_bytes_cmp = 0; uint32_t n_err_bytes = 0; noc_commander::noc_commander(sc_module_name name) : noc_tile(name) { SC_THREAD(main); SC_THREAD(recv_listener); // read bu...
/******************************************************************************* * encoder.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a testbench module to emulate a rotary quad encoder with a butt...
#include <systemc.h> class sc_mutexx : public sc_prim_channel { public: sc_event _free; bool _locked; // blocks until mutex could be locked void lock() { while( _locked ) { wait( _free ); } _locked = true; } // returns false if mutex could not be lock...
/******************************************************************************* * cd4067.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a simple model for the CD4067 Analog Mux. **********************...
#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...
/******************************************************************************* * st7735.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a testbench module to emulate the ST7735 display controller. **...
//----------------------------------------------------- #include <systemc.h> /** * @brief Enum that represents the main FPU operations * */ typedef enum { SC_FPU_ADD = 1, SC_FPU_SUB = 2, SC_FPU_MULT = 3, SC_FPU_DIV = 4 } sc_fpu_op_t; /** * @brief Class the represent and FPU using PV model * */ SC_MODU...
//This the top level structural host module //PS, dont forget to link systemc, stdc++, and m #include <systemc.h> #include "fir.h" #include "tb.h" SC_MODULE( SYSTEM ) { //module declarations //Done by doing module_name Pointer_to_instance i.e. name *iname; tb *tb0; fir *fir0; //signal declaration...
#include <systemc.h> #include "counter.cpp" int sc_main (int argc, char* argv[]) { sc_signal<bool> clock; sc_signal<bool> reset; sc_signal<bool> enable; sc_signal<sc_uint<4> > counter_out; int i = 0; // Connect the DUT first_counter counter("COUNTER"); counter.clock(clock); counter.reset(re...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/******************************************************************************* * mux_in.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Model for the PCNT mux in the GPIO matrix. ******************************...
#include "systemc.h" #include "system.h" #include "checksum.hpp" #include "noc_if.h" #include "noc_adapter.h" noc_adapter::noc_adapter(sc_module_name name, uint32_t x, uint32_t y) : sc_module(name), _x(x), _y(y), _is_redundant(false), _out_fifo_head(0), _out_fifo_tail(0) {} void noc_adapter::configure_redundanc...
/* * Copyright (c) 2010 TIMA Laboratory * * This file is part of Rabbits. * * Rabbits is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any la...
#include <systemc.h> #include "counter.h" #include "counter_tb.h" #include "constants.h" int sc_main(int argc, char* argv[]){ CounterModule* counter = new CounterModule("Counter"); CounterTestbench* testbench = new CounterTestbench("Testbench"); sc_clock Clock("Clock", 10, SC_NS, 0.5, 10, SC_NS, false); sc_si...
#ifndef IMG_ROUTER_CPP #define IMG_ROUTER_CPP // #include "tlm_transaction.cpp" #include "transaction_memory_manager.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_socke...
/***************************************************************************** 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 * * * * ...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
/******************************************************************************* * i2c.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Model for a I2C. *********************************************************...
/******************************************************************************* * gn_mixed.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a derivative of the sc_signal_resolved class from SystemC * w...
/******************************************************************************* * <DIRNAME>test.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is the main testbench for the <DIRNAME>.ino test. *********...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
#ifndef PACKET_GENERATOR_CPP #define PACKET_GENERATOR_CPP #include <systemc-ams.h> #include <systemc.h> #include "packetGenerator.h" void packetGenerator::set_attributes() { // Set a timestep for the TDF module set_timestep(sample_time); } void packetGenerator::fill_data(unsigned char* data, int packet_lengt...
//**************************************************************************************** // MIT License //**************************************************************************************** // Copyright (c) 2012-2020 University of Bremen, Germany. // Copyright (c) 2015-2020 DFKI GmbH Bremen, Germany. // Cop...
/* Problem 2 Design */ #include<systemc.h> SC_MODULE(counters) { sc_in<sc_uint<8> > in1 , in2 , in3; sc_in<bool> dec1 , dec2 , clock , load1 , load2; sc_out<sc_uint<8> > count1 , count2; sc_out<bool> ended; sc_signal<bool> isOverflow1 , isOverflow2; void handleCount1(); void handleCount2(); void updateEnde...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/******************************************************************************** * University of L'Aquila - HEPSYCODE Source Code License * * * * ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** 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...