text stringlengths 41 20k |
|---|
/*******************************************************************************
* TestSerial.cpp -- Copyright 2019 Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Generic Serial Class for communicating with a set of SystemC ports.
* ... |
#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... |
//
//------------------------------------------------------------//
// Copyright 2009-2012 Mentor Graphics Corporation //
// All Rights Reserved Worldwid //
// //
// Licensed under the Apache License, Version 2.0 (the ... |
/*******************************************************************************
* <DIRNAME>test.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* This is the main testbench for the <DIRNAME>.ino test.
*********... |
/*******************************************************************************
* uart.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Model for a UART.
*******************************************************... |
#include <systemc.h>
#include <i2c_controller.h>
void i2c_controller::clk_divider()
{
if(rst)
{
i2c_clk.write(1);
}
else
{
if(counter2 == 1)
{
bool t = i2c_clk.read();
i2c_clk.write(!t);
counter2 = 0;
}
else {
counter2 = counter2 + 1;
}
}
}
void i2c_controller::scl_controller()
{
... |
// **************************************************************************************
// User-defined memory manager, which maintains a pool of transactions
// From TLM Duolos tutorials
// **************************************************************************************
#ifndef TRANSACTION_MEMORY_MANAGER_CPP
#... |
/*******************************************************************************
* i2c.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Model for a I2C.
*********************************************************... |
/********************************************************************************
* University of L'Aquila - HEPSYCODE Source Code License *
* *
* ... |
ger->deleteConcXmlEnergy();
pSystemManager->updateXmlEnergy();
#endif
#if defined _SAVE_CSV_
myStatFile << "TOTAL ENERGY,";
myStatFile << to_string(totEnergy) +","; // @suppress("Function cannot be resolved")
#endif
#endif
/////////////////////////////////////////////////////////////////////////////... |
/*******************************************************************************
* 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... |
/*
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... |
/************************************************/
// Copyright tlm_noc contributors.
// Author Mike
// SPDX-License-Identifier: Apache-2.0
/************************************************/
#include <systemc.h>
#include <tlm.h>
#include <tlm_utils/peq_with_cb_and_phase.h>
#include <tlm_utils/simple_initiator_socket.h... |
/********************************************************************************
* University of L'Aquila - HEPSYCODE Source Code License *
* *
* ... |
#include<systemc.h>
#include<string>
#include<vector>
#include<map>
#include<fstream>
#include<nana/gui.hpp>
#include<nana/gui/widgets/button.hpp>
#include<nana/gui/widgets/menubar.hpp>
#include<nana/gui/widgets/group.hpp>
#include<nana/gui/widgets/textbox.hpp>
#include<nana/gui/filebox.hpp>
#include "top.hpp"
#include... |
inFile.open(path);
if(!inFile.is_open())
show_message("Arquivo inválido","Não foi possível abrir o arquivo!");
else
{
int i = 0;
int value;
while(inFile >> value && i < 500)
{
memor... |
// 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... |
/********************************************************************************
* University of L'Aquila - HEPSYCODE Source Code License *
* *
* ... |
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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 app... |
/*******************************************************************************
* mux_in.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Model for the PCNT mux in the GPIO matrix.
******************************... |
/*
* SysPE testbench for Harvard cs148/248 only
*/
#include "SysPE.h"
#include <systemc.h>
#include <mc_scverify.h>
#include <nvhls_int.h>
#include <vector>
#define NVHLS_VERIFY_BLOCKS (SysPE)
#include <nvhls_verify.h>
using namespace::std;
#include <testbench/nvhls_rand.h>
SC_MODULE (Source) {
Connections::Ou... |
#ifndef IPS_FILTER_TLM_CPP
#define IPS_FILTER_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 "ips_filter_... |
#include <systemc.h>
#include <string>
#include <vector>
#include <map>
#include <fstream>
#include <nana/gui.hpp>
#include <nana/gui/widgets/button.hpp>
#include <nana/gui/widgets/menubar.hpp>
#include <nana/gui/widgets/group.hpp>
#include <nana/gui/widgets/textbox.hpp>
#include <nana/gui/filebox.hpp>
#include "top.hp... |
&& i < 32)
{
reg_gui.at(i).text(1, std::to_string(value));
i++;
}
for (; i < 32; i++)
reg_gui.at(i).text(1, "0");
inFile.close();
} });
bench_sub->append("Bubble Sort", [&](menu::item_proxy &ip)
... |
#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... |
#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... |
#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... |
/********************************************************************************
* 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 <systemc.h>
SC_MODULE( or_gate )
{
sc_inout<bool> a;
sc_inout<bool> b;
sc_out<bool> c;
void or_process( void )
{
c = a.read() || b.read();
}
void test_process( void )
{
assert( (a.read() || b.read() ) == c.read() );
}
SC_CTOR( or_gate )
{
}
};
int sc_main( int argc, char * argv[... |
#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... |
#include <systemc.h>
SC_MODULE( or_gate )
{
sc_inout<bool> a;
sc_inout<bool> b;
sc_out<bool> c;
void or_process( void )
{
c = a.read() || b.read();
}
void test_process( void )
{
assert( (a.read() || b.read() ) == c.read() );
}
SC_CTOR( or_gate )
{
}
};
int sc_main( int argc, char * argv[... |
#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... |
/*****************************************************************************
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 <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;
struct ALU12 : public rand_obj {
randv< sc_bv<2> > op ;
randv< sc_uint<12> > a, b ;
ALU12()
: op(this), a(t... |
/*
Problem 3 Design
*/
#include<systemc.h>
SC_MODULE(communicationInterface) {
sc_in<sc_uint<12> > inData;
sc_in<bool> clock , reset , clear;
sc_out<sc_uint<4> > payloadOut;
sc_out<sc_uint<8> > countOut , errorOut;
void validateData();
SC_CTOR(communicationInterface) {
SC_METHOD(validateData);
sensitive<... |
//****************************************************************************************
// MIT License
//****************************************************************************************
// Copyright (c) 2012-2020 University of Bremen, Germany.
// Copyright (c) 2015-2020 DFKI GmbH Bremen, Germany.
// Cop... |
/*
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... |
#include <systemc.h>
#include "SYSTEM.h"
|
// Copyright 2019 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... |
return 0;
}
else if (spi->dev == NULL) {
PRINTF_INFO("HALSPI", "Attempting to access unsupported SPI%d",
spi->num);
return 0;
}
if(!spi->dev->ctrl.wr_bit_order){
data = __spiTranslate32(data);
}
SPI_MUTEX_LOCK();
spi->dev->mosi_dlen.usr_mosi_dbitlen = ... |
#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;
struct ALU32 : public rand_obj {
randv< sc_bv<2> > op ;
randv< sc_uint<32> > a, b ;
ALU32()
: op(this), a(t... |
/**
* 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... |
#include <systemc.h>
#include "full_adder.h"
#include "tb.h"
SC_MODULE( SYSTEM ) {
//Module Declarations
tb *tb0;
full_adder *full_adder0;
//Local signal declarations
sc_signal<bool> sig_inp_a, sig_inp_b,
sig_inp_cin, sig_sum, sig_co;
SC_HAS_PROCESS(SYSTEM);
SYSTEM( sc_module_name nm) : sc_module (nm... |
/*******************************************************************************
* sc_main.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* The sc_main is the first function always called by the SystemC environm... |
/*
Print.cpp - Base class that provides print() and println()
Copyright (c) 2008 David A. Mellis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 ... |
#include <systemc.h>
//
// Every HW component class has to be derived from :class:`hwt.hwModule.HwModule` class
//
// .. hwt-autodoc::
//
SC_MODULE(Showcase0) {
// ports
sc_in<sc_uint<32>> a;
sc_in<sc_int<32>> b;
sc_out<sc_uint<32>> c;
sc_in_clk clk;
sc_out<sc_uint<1>> cmp_0;
sc_o... |
#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 <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <tlm_utils/peq_with_cb_and_phase.h>
#in... |
/*****************************************************************************
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 <and.h>
#include <testbench.h>
int sc_main(int argv, char* argc[]) {
sc_time PERIOD(10,SC_NS);
sc_time DELAY(10,SC_NS);
sc_clock clock("clock",PERIOD,0.5,DELAY,true);
And and1("and1");
testbench tb("tb");
sc_signal<bool> a_sg,b_sg,c_sg;
and1.a(a_sg);
and1.b(b_sg);
and1.c(c_s... |
/*
* 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... |
/********************************************************************************
* University of L'Aquila - HEPSYCODE Source Code License *
* *
* ... |
oat idI4CSmin = 0;
pu.setI4CSmin(idI4CSmin);
float idI4CSmax = 0;
pu.setI4CSmax(idI4CSmax);
// PU-Vdd (V)
float idVdd = 0;
pu.setVdd(idVdd);
// PU-Idd (A)
float idIdd = 0;
pu.setIdd(idIdd);
// PU-overheadCS (us)
float idOver = 0;
pu.setOverheadCS(sc_time((int)idOver, SC_US));
... |
object/node structure
//pugi::xml_node instancesPS2 = myDoc.child("instancesPS");
//for (pugi::xml_node_iterator seqProcess_it=instancesPS2.begin(); seqProcess_it!=instancesPS2.end(); ++seqProcess_it){
// int Id = atoi(seqProcess_it->child_value("id"));
//
// if(seqProcess_it->child("WCET")){
// pugi::xml_node ... |
/********************************************************************************
* University of L'Aquila - HEPSYCODE Source Code License *
* *
* ... |
er 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(index) != EXIT_SUCCESS )
// return( -1 ); // less than zero errors <==> the ANN isn't c... |
/*****************************************************************************
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) 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... |
// ----------------------------------------------------------------------------
// SystemC SCVerify Flow -- sysc_sim_trans.cpp
//
// HLS version: 10.4b/841621 Production Release
// HLS date: Thu Oct 24 17:20:07 PDT 2019
// Flow Packages: HDL_Tcl 8.0a, SCVerify 10.4
//
// Generated by: billyk@cad.eecs.harvar... |
_rtl_SIG_weight_in_vec_4_rdy << ccs_rtl_SIG_weight_in_vec_5_rdy << ccs_rtl_SIG_weight_in_vec_6_rdy << ccs_rtl_SIG_weight_in_vec_7_rdy << weight_in_vec[0].Connections::InBlocking<ac_int<8, true >, Connections::SYN_PORT >::msg << weight_in_vec[1].Connections::InBlocking<ac_int<8, true >, Connections::SYN_PORT >::msg << w... |
eld_key=accum_out_vec:6bfbc86a-4643-405d-8ac5-31fb9eb3828c-869:rdy:6bfbc86a-4643-405d-8ac5-31fb9eb3828c-888
type_to_vector(accum_out_vec[3].Connections::OutBlocking_Ports_abs<ac_int<32, true > >::rdy.read(),1,t_6bfbc86a_4643_405d_8ac5_31fb9eb3828c_888); // read orig port and type convert
ccs_rtl_SIG_accum_out_vec... |
/*
* Created on: 21. jun. 2019
* Author: Jonathan Horsted Schougaard
*/
#ifdef HW_COSIM
//#define __GMP_WITHIN_CONFIGURE
#endif
#define DEBUG_SYSTEMC
#define HLS_APPROX_TIME
#define SC_INCLUDE_FX
#include "hwcore/tb/pipes/tb_imagedatafix.h"
#include <systemc.h>
unsigned errors = 0;
const char simulation_nam... |
/*
* 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... |
#ifndef IPS_FILTER_TLM_CPP
#define IPS_FILTER_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 "ips_filter_... |
/*
* Created on: 21. jun. 2019
* Author: Jonathan Horsted Schougaard
*/
#ifdef HW_COSIM
//#define __GMP_WITHIN_CONFIGURE
#endif
#define SC_INCLUDE_FX
#include <systemc.h>
#include "hwcore/tb/improc/tb_imfilter.h"
unsigned errors = 0;
const char simulation_name[] = "dma tester test";
int sc_main(int argc, cha... |
#include <pthread.h>
#include <systemc.h>
#include "sc_main.h"
#include "sc_run.h"
//#include "sc_config.h"
#include "sc_qt_adaptor.h"
//#include "sc_rst.h"
//#include "sc_clk.h"
//#include "sc_mux.h"
//#include "sc_tri.h"
//#include "sc_terminals.h"
//#include "sc_gates.h"
//#include "sc_gates_pv.h"
//#include "sc_re... |
/*
* SysAttay testbench, for Harvard cs148/248 only
*/
#include "SysArray.h"
#include <systemc.h>
#include <mc_scverify.h>
#include <nvhls_int.h>
#include <vector>
#define NVHLS_VERIFY_BLOCKS (SysArray)
#include <nvhls_verify.h>
using namespace::std;
#include <testbench/nvhls_rand.h>
// W/I/O dimensions
const st... |
//--------------------------------------------------------
//Testbench: Unification
//By: Roger Morales Monge
//Description: Simple TB for pixel unification modules
//--------------------------------------------------------
#ifndef USING_TLM_TB_EN
#define STB_IMAGE_IMPLEMENTATION
#include "include/stb_image.h"
#define... |
/********************************************************************************
* University of L'Aquila - HEPSYCODE Source Code License *
* *
* ... |
/*
* @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){
... |
// Copyright 2019 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... |
#ifndef USING_TLM_TB_EN
#define int64 systemc_int64
#define uint64 systemc_uint64
#include <systemc.h>
#undef int64
#undef uint64
#define int64 opencv_int64
#define uint64 opencv_uint64
#include <opencv2/opencv.hpp>
#undef int64
#undef uint64
#include "vga.hpp"
// Image path
#define IPS_IMG_PATH_TB "../../tools/d... |
/*******************************************************************************
* gpio_mf.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Implements a SystemC model of a generic multi-function GPIO with
* ana... |
/*******************************************************************************
* espintr.cpp -- Copyright 2020 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Implements a SystemC module for the ESP32 interrupt management.
********... |
/**************************************************************************
* *
* Catapult(R) Machine Learning Reference Design Library *
* *
* Software Ver... |
/*******************************************************************************
* sc_main.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* The sc_main is the first function always called by the SystemC environm... |
//****************************************************************************************
// MIT License
//****************************************************************************************
// Copyright (c) 2012-2020 University of Bremen, Germany.
// Copyright (c) 2015-2020 DFKI GmbH Bremen, Germany.
// Cop... |
#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;
struct ALU24 : public rand_obj {
randv< sc_bv<2> > op ;
randv< sc_uint<24> > a, b ;
ALU24()
: op(this), a(t... |
/*****************************************************************************
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 *
* *
* ... |
#include <systemc.h>
#include <string>
#include "fetch.h"
#include "testbench.h"
int sc_main(int argv, char* argc[]) {
sc_time PERIOD(10,SC_NS);
sc_time DELAY(10,SC_NS);
sc_clock clock("clock",PERIOD,0.5,DELAY,true);
fetch ft("fetch");
testbench tb("tb");
sc_signal< sc_uint<14> > instruction_sg;
sc_s... |
#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... |
/*****************************************************************************
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>
//
// Every HW component class has to be derived from :class:`hwt.hwModule.HwModule` class
//
// .. hwt-autodoc::
//
SC_MODULE(Showcase0) {
// ports
sc_in<sc_uint<32>> a;
sc_in<sc_int<32>> b;
sc_out<sc_uint<32>> c;
sc_in_clk clk;
sc_out<sc_uint<1>> cmp_0;
sc_o... |
// nand gate
// Luciano Sobral <sobral.luciano@gmail.com>
// this sample should fail
#include <systemc.h>
SC_MODULE(nand_gate)
{
sc_inout<bool> a;
sc_inout<bool> b;
sc_out<bool> c;
void nand_process(void)
{
and_process(); // c = a and b
c = !c.read(); // c = not c
}
void and_process ( void )
{
c = a... |
// nand gate
// Luciano Sobral <sobral.luciano@gmail.com>
// this sample should fail
#include <systemc.h>
SC_MODULE(nand_gate)
{
sc_inout<bool> a;
sc_inout<bool> b;
sc_out<bool> c;
void nand_process(void)
{
and_process(); // c = a and b
c = !c.read(); // c = not c
}
void and_process ( void )
{
c = a... |
/*****************************************************************************
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 *
... |
#include <systemc.h>
SC_MODULE (hello) { // module named hello
SC_CTOR (hello) { //constructor phase, which is empty in this case
}
void say_hello() {
std::cout << "Hello World!" << std::endl;
}
};
int sc_main(int argc, char* argv[]) {
hello h("hello");
h.say_hello();
return 0;
}
|
#include <systemc.h>
#include <i2c_controller_tb.h>
#include <i2c_controller.h>
#include <i2c_slave_controller.h>
int sc_main(int argc, char* argv[])
{
sc_signal<bool> rst;
sc_signal<sc_uint<7>> addr;
sc_signal<sc_uint<8>> data_in;
sc_signal<bool> enable;
sc_signal<bool> rw;
sc_signal<sc_lv<8>... |
#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;
struct ALU24 : public rand_obj {
randv< sc_bv<2> > op ;
randv< sc_uint<24> > a, b ;
ALU24()
: op(this), a(t... |
/**
#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;... |
/*
* @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>... |
/*******************************************************************************
* gpio_mf.cpp -- Copyright 2019 (c) Glenn Ramalho - RFIDo Design
*******************************************************************************
* Description:
* Implements a SystemC model of a generic multi-function GPIO with
* ana... |
/*****************************************************************************
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 "sc_run.h"
#include <systemc.h>
static int scThreadResult = 0;
static sc_thread_run_t *scThreadRun = nullptr;
int sc_getRunResultFromUI(void) { return scThreadResult; }
void sc_setRunFromUI(sc_thread_run_t *theRun) { scThreadRun = theRun; }
void sc_setRunResult(int theResult) {scThreadResult = theResult; }
... |
#include "systemc.h"
#include "systemperl.h"
#include "verilated_vcd_c.h"
#include "env_memory.h"
#include "tv_responder.h"
#include "Vtv80s.h"
#include "VT16450.h"
#include "SpTraceVcd.h"
#include <unistd.h>
#include "z80_decoder.h"
#include "di_mux.h"
extern char *optarg;
extern int optind, opterr, optopt;
#define ... |
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
// DESCRIPTION: Verilator: Emit Makefile
//
// Code available from: https://verilator.org
//
//*************************************************************************
//
// Copyright 2004-2022 by ... |
//This is simple Producer/Consumer example
//For more examples check
//http://www.asic-world.com/systemc/
//must include to use the systemc library
#include "systemc.h"
#include "pc.h"
#include "headers.h"
void Example::producerThread(){
cout << sc_time_stamp() << ": Initializing producerThread\n";
int x;
//a t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.