#ifndef _DATASTRUCS_H__
#define _DATASTRUCS_H__ #include <systemc.h>
#include "GlobalParams.h" ................省略内容 #endif
 // Coord -- XY coordinates type of the Tile inside the Mesh
class Coord {
public:
int x; // X coordinate
int y; // Y coordinate
//操作符重载,调用方式if(c1 == c2)
//括号中的const表示参数coord对象不会被修改,最后的const表明调用函数对象不会被修改
inline bool operator ==(const Coord & coord) const {
return (coord.x == x && coord.y == y);
}};

class Coord

 // FlitType -- Flit type enumeration
enum FlitType {
FLIT_TYPE_HEAD, FLIT_TYPE_BODY, FLIT_TYPE_TAIL
};

payload可以是flit,也可以是credit

 // Payload -- Payload definition
struct Payload {
//sc_uint为无符号整数类型
sc_uint<> data; // Bus for the data to be exchanged inline bool operator ==(const Payload & payload) const {
return (payload.data == data);
}};

struct Payload

 // Packet -- Packet definition
struct Packet {
int src_id;
int dst_id;
double timestamp; // SC timestamp at packet generation
int size;
int flit_left; // Number of remaining flits inside the packet
bool use_low_voltage_path; // Constructors
Packet() { } Packet(const int s, const int d, const double ts, const int sz) {
make(s, d, ts, sz);
}
//初始化packet
void make(const int s, const int d, const double ts, const int sz) {
src_id = s;
dst_id = d;
timestamp = ts;
size = sz;
flit_left = sz;
use_low_voltage_path = false;
}
};

struct Packet

 // Flit -- Flit definition
struct Flit {
int src_id;
int dst_id;
FlitType flit_type; // The flit type (FLIT_TYPE_HEAD, FLIT_TYPE_BODY, FLIT_TYPE_TAIL)
int sequence_no; // The sequence number of the flit inside the packet
int sequence_length;
Payload payload; // Optional payload
double timestamp; // Unix timestamp at packet generation
int hop_no; // Current number of hops from source to destination
bool use_low_voltage_path;
//操作符重载
inline bool operator ==(const Flit & flit) const {
return (flit.src_id == src_id && flit.dst_id == dst_id
&& flit.flit_type == flit_type
&& flit.sequence_no == sequence_no
&& flit.sequence_length == sequence_length
&& flit.payload == payload && flit.timestamp == timestamp
&& flit.hop_no == hop_no
&& flit.use_low_voltage_path == use_low_voltage_path);
}};

struct Flit

 // RouteData -- data required to perform routing
struct RouteData {
int current_id;
int src_id;
int dst_id;
int dir_in; // direction from which the packet comes from
};

struct RouteData

 struct ChannelStatus {
int free_slots; // occupied buffer slots
bool available; // inline bool operator ==(const ChannelStatus & bs) const {
return (free_slots == bs.free_slots && available == bs.available);
};
};

struct ChannelStatus

 // NoP_data -- NoP Data definition  Neighbor-on-Path
struct NoP_data {
int sender_id;
ChannelStatus channel_status_neighbor[DIRECTIONS]; inline bool operator ==(const NoP_data & nop_data) const {
return (sender_id == nop_data.sender_id &&
nop_data.channel_status_neighbor[] ==
channel_status_neighbor[]
&& nop_data.channel_status_neighbor[] ==
channel_status_neighbor[]
&& nop_data.channel_status_neighbor[] ==
channel_status_neighbor[]
&& nop_data.channel_status_neighbor[] ==
channel_status_neighbor[]);
};
};

struct NoP_data

 typedef struct
{
string label;
double value;
} PowerBreakdownEntry;
 enum
{
BUFFER_PUSH_PWR_D,
BUFFER_POP_PWR_D,
BUFFER_FRONT_PWR_D,
BUFFER_TO_TILE_PUSH_PWR_D,
BUFFER_TO_TILE_POP_PWR_D,
BUFFER_TO_TILE_FRONT_PWR_D,
BUFFER_FROM_TILE_PUSH_PWR_D,
BUFFER_FROM_TILE_POP_PWR_D,
BUFFER_FROM_TILE_FRONT_PWR_D,
ANTENNA_BUFFER_PUSH_PWR_D,
ANTENNA_BUFFER_POP_PWR_D,
ANTENNA_BUFFER_FRONT_PWR_D,
ROUTING_PWR_D,
SELECTION_PWR_D,
CROSSBAR_PWR_D,
LINK_R2R_PWR_D,
LINK_R2H_PWR_D,
NI_PWR_D,
WIRELESS_TX,
WIRELESS_DYNAMIC_RX_PWR,
WIRELESS_SNOOPING,
NO_BREAKDOWN_ENTRIES_D
}; enum
{
TRANSCEIVER_RX_PWR_BIASING,
TRANSCEIVER_TX_PWR_BIASING,
BUFFER_ROUTER_PWR_S,
BUFFER_TO_TILE_PWR_S,
BUFFER_FROM_TILE_PWR_S,
ANTENNA_BUFFER_PWR_S,
LINK_R2H_PWR_S,
ROUTING_PWR_S,
SELECTION_PWR_S,
CROSSBAR_PWR_S,
NI_PWR_S,
TRANSCEIVER_RX_PWR_S,
TRANSCEIVER_TX_PWR_S,
NO_BREAKDOWN_ENTRIES_S
};

enum

 typedef struct
{
int size;
PowerBreakdownEntry breakdown[NO_BREAKDOWN_ENTRIES_D+NO_BREAKDOWN_ENTRIES_S];
} PowerBreakdown;

DataStructs.h的更多相关文章

  1. Buffer.h

    #ifndef __NOXIMBUFFER_H__ #define __NOXIMBUFFER_H__ #include <cassert> #include <queue> ...

  2. ProcessingElement.h

    processing element模块 #ifndef __NOXIMPROCESSINGELEMENT_H__ #define __NOXIMPROCESSINGELEMENT_H__ #incl ...

  3. Noxim Overview

    PE+Router= Tile Node Architectural Elements: Buffer.h, Router.h, LocalRoutingTable.h, Tile.h, NoC.h, ...

  4. APUE中fcntl.h的使用及O_SYNC在Mac与Ubuntu下的测试

    此部分测试涉及到APUE V3中,第三章的图3-12到图3-14. 通过fcntl.h提供的功能,修改fd的文件属性,本处增加O_SYNC功能,并测试其效果. 本文涉及代码: tree ch3 ch3 ...

  5. 关于apue.3e中apue.h的使用

    关于apue.3e中apue.h的使用 近来要学一遍APUE第三版,并于此开博做为记录. 先下载源文件: # url: http://http//www.apuebook.com/code3e.htm ...

  6. YYModel 源码解读(二)之NSObject+YYModel.h (1)

    本篇文章主要介绍 _YYModelPropertyMeta 前边的内容 首先先解释一下前边的辅助函数和枚举变量,在写一个功能的时候,这些辅助的东西可能不是一开始就能想出来的,应该是在后续的编码过程中 ...

  7. YYModel 源码解读(一)之YYModel.h

    #if __has_include(<YYModel/YYModel.h>) FOUNDATION_EXPORT double YYModelVersionNumber; FOUNDATI ...

  8. error RC1015: cannot open include file 'afxres.h' 解决办法

    在为WindowsPhone8程序添加本地化的过程中遇到这个问题: 问题原因就是afxres.h文件缺失,下载它,放到VS安装目录下的VS\include目录下就可以了(选择目录的时候注意对应对版本) ...

  9. afxcomctl32.h与afxcomctl32.inl报错

    afxcomctl32.h与afxcomctl32.inl报错 编译公司一个几年前的老项目,是从VC6.0升级到VS2005的. 1.编译时报缺少头文件,于是附件包含目录,于是出现了以下报错: 1&g ...

随机推荐

  1. [Flutter] Windows/MacOS Flutter 环境走一遍

    Windows Install 1.系统需要:> win7 > 400M磁盘空间 Windows PowerShell(Windows 搜索框中找) Git for Windows 2.x ...

  2. Android Spannable为同一TextView设直不同样式

    /** * UNICODE * <p> * 偶尔吃(1-2次/周) ( 中文破弧 * 经常吃(3-5次/周) ( 英文破弧 * * @param name * @return */ pri ...

  3. Centos6.3下搭建apache+https服务

    1. 安装插件 yum install mod_ssl openssl openssl-devel --downloadonly --downloaddir=/home/https 2.生成私钥 op ...

  4. layui xtree 实现一级节点单选 ,子节点复选

    在外部定义变量和方法 //定义变量 接收顶级节点的值 var topValue; // 获取顶级节点值的方法 function getParent(value) { var val = project ...

  5. 【深入Java虚拟机(1)】:Java内存区域与内存溢出

    原文出处: 兰亭风雨 内存区域 Java虚拟机在执行Java程序的过程中会把他所管理的内存划分为若干个不同的数据区域.Java虚拟机规范将JVM所管理的内存分为以下几个运行时数据区:程序计数器.Jav ...

  6. Form-encoded method must contain at least one @Field.

    https://blog.csdn.net/liunian823/article/details/80290855 记得之前遇到过这个问题,并且记录笔记了,这次再翻笔记,却没有找到...搜索 了下. ...

  7. MongoDB集群的搭建

    一.环境准备 1.Centos7 2.mongodb3.4.10 3.三台机器IP分别是:192.168.1.100.192.168.1.135.192.168.1.136 二.mongdb数据库的安 ...

  8. LVS(一):基本概念和三种模式

    网站架构中,负载均衡技术是实现网站架构伸缩性的主要手段之一.所谓"伸缩性",是指可以不断向集群中添加新的服务器来提升性能.缓解不断增加的并发用户访问压力. 负载均衡有好几种方式:h ...

  9. PowerScript语句

    赋值语句 赋值语句可以把一个表达式的结果或者变量和常量的值,赋给一个变量或者对象的属性或成员变量.赋值语句的格式是: variablename = expression 其中variablename代 ...

  10. mongocxx-driver编译安装

    1. 确保安装epel yum install -y epel-release 2. 按照<CentOS7.2部署node-mapnik>一文中的步骤,手动安装 gcc-6.2.0 和 b ...