DataStructs.h
#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的更多相关文章
- Buffer.h
#ifndef __NOXIMBUFFER_H__ #define __NOXIMBUFFER_H__ #include <cassert> #include <queue> ...
- ProcessingElement.h
processing element模块 #ifndef __NOXIMPROCESSINGELEMENT_H__ #define __NOXIMPROCESSINGELEMENT_H__ #incl ...
- Noxim Overview
PE+Router= Tile Node Architectural Elements: Buffer.h, Router.h, LocalRoutingTable.h, Tile.h, NoC.h, ...
- APUE中fcntl.h的使用及O_SYNC在Mac与Ubuntu下的测试
此部分测试涉及到APUE V3中,第三章的图3-12到图3-14. 通过fcntl.h提供的功能,修改fd的文件属性,本处增加O_SYNC功能,并测试其效果. 本文涉及代码: tree ch3 ch3 ...
- 关于apue.3e中apue.h的使用
关于apue.3e中apue.h的使用 近来要学一遍APUE第三版,并于此开博做为记录. 先下载源文件: # url: http://http//www.apuebook.com/code3e.htm ...
- YYModel 源码解读(二)之NSObject+YYModel.h (1)
本篇文章主要介绍 _YYModelPropertyMeta 前边的内容 首先先解释一下前边的辅助函数和枚举变量,在写一个功能的时候,这些辅助的东西可能不是一开始就能想出来的,应该是在后续的编码过程中 ...
- YYModel 源码解读(一)之YYModel.h
#if __has_include(<YYModel/YYModel.h>) FOUNDATION_EXPORT double YYModelVersionNumber; FOUNDATI ...
- error RC1015: cannot open include file 'afxres.h' 解决办法
在为WindowsPhone8程序添加本地化的过程中遇到这个问题: 问题原因就是afxres.h文件缺失,下载它,放到VS安装目录下的VS\include目录下就可以了(选择目录的时候注意对应对版本) ...
- afxcomctl32.h与afxcomctl32.inl报错
afxcomctl32.h与afxcomctl32.inl报错 编译公司一个几年前的老项目,是从VC6.0升级到VS2005的. 1.编译时报缺少头文件,于是附件包含目录,于是出现了以下报错: 1&g ...
随机推荐
- SqlServer查询表名的备注(查询表名描述 MS_Description)
查询表名描述 MS_Description ? 1 2 3 4 5 SELECT tbs.name 表名,ds.value 描述 FROM sys.extended_properties ...
- CSS 图像左右对齐
左右对齐图像使用的技术是浮动div元素. float:left 左对齐 float:right右对齐 示例 <!DOCTYPE html> <html> <hea ...
- Blender软件基本介绍(3D建模软件)
1.Blender的好处: 1>.开源免费 2>.体积比较小 3>.和Unity的交互比较好(一般建模软件需要导出FBX的文件,然后用到Unity中,而Blender不需要导出,只需 ...
- try-catch-finally 与返回值的修改
先看一段java代码,func返回值为int: public static int func() { int result = 0; try { result = 1; return result; ...
- 您可能不知道的CSS元素隐藏“失效”以其妙用
您可能不知道的CSS元素隐藏“失效”以其妙用 by zhangxinxu from http://www.zhangxinxu.com地址:http://www.zhangxinxu.com/word ...
- 后台商品搜索功能开发SQL
在做后台的商品搜索功能开发时遇到了一些问题记录下来 版本一 <select id="SelectByNameAndParentId resultMap="Base_resul ...
- 求数组中两数之和等于target的两个数的下标
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标. 你可以假设每种输入只会对应一个答案.但是,你不能重复利用这个数组中同样的元 ...
- CentOS7+CDH5.14.0安装全流程记录,图文详解全程实测-3禁止交换和禁用大页面
1.禁止交换(每台机器都要做): 执行命令:vim /etc/sysctl.conf 增加一行:vm.swappiness=0 执行命令:sudo sysctl vm.swappiness=0 2.禁 ...
- JavaSE基础知识(5)—面向对象(5.6 static关键字)
一.说明 static属于一种修饰符,可以用于修饰 属性.方法.初始化块.内部类用static修饰的成员,称为静态成员不用static修饰的成员,称为普通成员 二.静态属性的特点 1.生命周期 静态属 ...
- OkHttp的get和post请求
OkHttp的get.Post 由于没有看过书籍,不能将理论正确的描述出来,只能根据自己的理解,带大家认识下java开发下的OkHttp的get和post两种请求方式. 依赖的包为:okio-1.15 ...