Tictoc12 是在 Tictoc11 的基础上,进一步简化,使用双向连接,首先是一个双向门:
gates:
inout gate[]; // declare two way connections
网络的连接部分就变成了:
connections:
tic[0].gate++ <--> Channel <--> tic[1].gate++;
tic[1].gate++ <--> Channel <--> tic[2].gate++;
tic[1].gate++ <--> Channel <--> tic[4].gate++;
tic[3].gate++ <--> Channel <--> tic[4].gate++;
tic[4].gate++ <--> Channel <--> tic[5].gate++;
.cc 文件中:
// $o and $i suffix is used to identify the input/output part of a two way gate
send(msg, "gate$o", k);
suffix 是后缀的意思。
gate$o
表示输出;
gate$i
表示输入。