text
stringlengths
41
20k
/* * @ASCK */ #include <systemc.h> SC_MODULE (Memory) { sc_in <bool> r_nw; sc_in <sc_uint<13>> addr; sc_in <sc_int<8>> data; sc_out <sc_int<8>> out; /* ** module global variables */ sc_int<8> mem[8192] = {0}; // 2^13 rows bool done = false; SC_CTOR (Memory){ ...
#include <systemc.h> SC_MODULE (counter) { sc_in_clk clock ; // Clock input of the design sc_in<bool> reset ; // active high, synchronous Reset input sc_in<bool> enable; // Active high enable signal for counter sc_out<sc_uint<4> > counter_out; // 4 bit vector output of the counter //L...
/* * 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...
/* * @ASCK */ #include <systemc.h> SC_MODULE (IF) { sc_in_clk clk; sc_in <sc_uint<20>> prev_data; sc_out <sc_uint<20>> next_data; /* ** module global variables */ SC_CTOR (IF){ SC_THREAD (process); sensitive << clk.pos(); } void process () { w...
/* * @ASCK */ #include <systemc.h> SC_MODULE (Memory) { sc_in <bool> r_nw; sc_in <sc_uint<13>> addr; sc_in <sc_int<8>> data; sc_out <sc_int<8>> out; /* ** module global variables */ sc_int<8> mem[8192] = {0}; // 2^13 rows bool done = false; SC_CTOR (Memory){ ...
/***************************************************************************** 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 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
#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 ...
/******************************************************************************** * University of L'Aquila - HEPSYCODE Source Code License * * * * ...
/****************************************************************************** * This file is part of 3D-ICE, version 3.1.0 . * * * * 3D-ICE is free software: you can redistribute it and/or modify it under * ...
//--------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...
/******************************************************************************* * 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. *******************************************************...
/***************************************************************************** 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 "systemc.h" #include "mwr.h" #include "vcml.h" #include "spikevp/system.h" int sc_main(int argc, char *argv[]) { spikevp::system system("system"); return system.run(); }
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
#include <systemc.h> SC_MODULE (hello_world) { SC_CTOR (hello_world) { } void say_hello() { cout << "Hello World SystemC-2.3.1.\n"; } }; int sc_main(int argc, char* argv[]) { hello_world hello("HELLO"); hello.say_hello(); return(0); }
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* Problem 1 Design */ #include<systemc.h> SC_MODULE(sequenceDetector) { sc_in<bool> clock , reset , clear; sc_in<bool> input; sc_out<bool> output; sc_out<bool> state; void detectorAlgo(); void updateValues(); enum states {S1,S2,S3,S4,S5}; sc_signal<states> currentState , nextState; SC_CTOR(sequenceDetec...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
//----------------------------------------------------- #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) { ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
#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...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/************************************************************************** * * * 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...
#include <systemc.h> // // Basic d flip flop // // :attention: using this unit is pointless because HWToolkit can automatically // generate such a register for any interface and datatype // // .. hwt-autodoc:: // SC_MODULE(DReg) { // ports sc_in_clk clk; sc_in<sc_uint<1>> din; sc_ou...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/******************************************************************************* * task.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This file reimplements the freertos tasks to get them to compile under the * ...
/////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2019 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 // ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* * 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...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
// 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...
/* * @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 <Gemmini.h> #include <systemc.h> #include <ac_int.h> #include <ac_std_float.h> #include <cfenv> template<class To, class From> To _bit_cast(const From& src) noexcept { To dst; std:: memcpy(&dst, &src, sizeof(To)); return dst; } sc_biguint<8> Gemmini::ScaleInputType(sc_biguint<8> input,sc_biguin...
/******************************************************************************* * cd4097_channel.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * This is a simple model for a single channel of a CD4079 dual ana...
#include "memory.h" #include "system.h" #include "systemc.h" /** Read formatted binary file with data and text sections. */ uint32_t read_input_file(mem_cursor_t *cursors, uint32_t max_n_cursor, uint32_t *out, uint32_t max_mem_size) { // open ASM file FILE *fp = fopen(get_asm_file_name(), "rb"); if (!fp...
/******************************************************************************* * clkgen.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design ******************************************************************************* * Description: * Emulates the clocks on the ESP32. ***************************************...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/******************************************************************************** * 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 ...
// ================================================================ // 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...
// //------------------------------------------------------------// // Copyright 2009-2012 Mentor Graphics Corporation // // All Rights Reserved Worldwid // // // // Licensed under the Apache License, Version 2.0 (the ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
#include <systemc.h> #include "HammingRegister.h" void HamReg::ham_main_din(){ din.read(); } void HamReg::ham_main_codedin(){ coded_din.read(); }
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/* Copyright (c) 2015 Convey Computer Corporation * * This file is part of the OpenHT toolset located at: * * https://github.com/TonyBrewer/OpenHT * * Use and distribution licensed under the BSD 3-clause license. * See the LICENSE file for the complete license text. */ // Synthesize.cpp // /////////////////////...
nt *pInstancePort = instanceIter->FindIdent(modulePortIter->GetName()); CHtvIdent *pSignal = 0; if (pInstancePort) { pSignal = pInstancePort->GetPortSignal(); Assert(pSignal); } else { string signalName = modulePortIter->GetName(); ...
etMember(); if (pIdent == 0 || pIdent->IsScState() || (pIdent->IsLocal() && !pIdent->IsFunction())) return; if (pIdent->GetId() == CHtvIdent::id_function) { for (unsigned int i = 0; i < pExpr->GetParamCnt(); i += 1) { //bool bIsReadOnly = pIdent->GetParamIsConst...
return false; } pLastStatement = pStatement2; } CHtvOperand *pExpr = pLastStatement->GetExpr(); // all right hand sides of assignment states were constants // all left hand sides are the same variable if (pExpr->GetOperand1()->GetSubFieldWidth() == pExpr->GetOperand1()->GetM...
Hier, pObj, pRtnObj, pStatement->GetCompound1()); m_vFile.DecIndentLevel(); m_vFile.Print("end\n"); m_vFile.DecIndentLevel(); } // default statement must be at the end of the case statement if (pDefaultStatement && pDefaultStatement->GetCompound1() && pDefaultStatement->GetCompound...
pExpr->SetVerWidth( pExpr->GetOpWidth() ); if (pOp1->GetVerWidth() < pExpr->GetOpWidth() && (!pOp1->IsConstValue() || pOp1->GetOpWidth() < pExpr->GetOpWidth()) && pOp2->GetVerWidth() < pExpr->GetOpWidth() && (!pOp2->IsConstValue() || pOp2->GetOpWidth() < pExpr->GetOpWidth())) ...
arName, pExpr->GetOpWidth())); } break; case tk_comma: break; case tk_lessLess: case tk_greaterGreater: if (pOp1->GetVerWidth() < pExpr->GetOpWidth() && !pOp1->HasExprTempVar()) { pOp1->SetIsSubExprRequired(true); pOp1->SetExprTempVar( GetTempVarName(GetExprBlockId(), tempVarList.size()), p...
ring bitRange; if (pParamType->GetWidth() > 1) bitRange = VA("[%d:0] ", pParamType->GetWidth()-1); string identName = pFunction->GetParamName(paramId); CHtvIdent *pParamIdent = pFunction->FindIdent(identName); if (pParamIdent->IsReadOnly()) { GenHtAttributes(pPa...
sFieldTempVar()) PrintSubExpr(pObj, pRtnObj, pExpr->GetOperand2(), false, true); } m_vFile.DecIndentLevel(); if (bBeginEnd) m_vFile.Print("end\n"); } else { m_vFile.Print("\n"); PrintSubExpr(pObj, pRtnObj, pExpr->GetOperand2(), false, true); m_vFil...
2() * idxBase); idx += pSubField->m_indexList[i]->GetConstValue().GetSint32() * idxBase; pPrefix = " + "; } } else { m_vFile.Print("%s%d * %s(", pPrefix, pSubField->m_subFieldWidth * idxBase, g_htvArgs.IsQuartusEnabled() ? "(* multstyle = \"lo...
CHtvOperand *pOp13 = pExpr1->GetOperand3(); CHtvOperand *pOp21 = pExpr2->GetOperand1(); CHtvOperand *pOp22 = pExpr2->GetOperand2(); CHtvOperand *pOp23 = pExpr2->GetOperand3(); if (pOp11 && !!IsExpressionEquivalent(pOp11, pOp21)) return false; if (pOp12 && !!IsE...
fprintf(fp, "\tfriend class CRndGen;\n"); fprintf(fp, "public:\n"); fprintf(fp, "\tCRandom() {}\n"); fprintf(fp, "\t// ~CRandom() {};\n"); fprintf(fp, "\tvoid Seed(unsigned int init) { m_rndGen.Seed(init); }\n"); fprintf(fp, "\n"); fprintf(fp, "\tbool RndBool() { return (m_rndGen.AsUint32() & ...
"\tCFixture() {\n"); fb.Print("#endif// __SYSTEM_C__\n"); fb.Print("\n"); fb.Print("\t#ifndef _SC_LINT\n"); fb.Print("\n"); fb.Print("\tCFixtureTest::SetModel(&m_model);\n"); fb.Print("\n"); if (pModule->GetClockListCnt() > 1) { string clkName = pModule->GetClockList()[1]->GetName()...
if (userLinesBegin[3] == userLinesEnd[3]) { fb.Print("\t\t\t\texit(0);\n"); } else { for (int i = userLinesBegin[3]; i < userLinesEnd[3]; i += 1) fb.Write(userLines[i].c_str()); } fb.Print("\t\t\t\t//<<\n"); fb.Print("\t\t\t}\n"); fb.Print("\n"); fb.Print("\t\t} el...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/***************************************************************************** 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> SC_MODULE (events) { sc_in<bool> clock; sc_event e1; sc_event e2; void do_test1() { while (true) { // Wait for posedge of clock wait(); cout << "@" << sc_time_stamp() <<" Starting test"<<endl; // Wait for posedge of clock wait(); cout << "@" << s...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...
/////////////////////////////////////////////////////////////////////////////////// // __ _ _ _ // // / _(_) | | | | // // __ _ _ _ ___ ___ _ __ | |_ _ ___| | __| | ...