我正在尝试使用邮箱了解以下 FIFO 代码。我可以理解其中的大部分内容,但是 void'(FIFO.tryput(write_data)); // nonblocking write
- void'(FIFO.tryget(read_data) ); // nonblocking read
void 的目的是什么?我知道 void 是什么,但 程序中的void
和void'
是否相同?
interface fifo_channel_1 #(parameter FifoSize = 8, PtrSize = 4,
parameter type DataType = uniType);
DataType write_data; // packet coming from sending module
DataType read_data; // packet going to receiving module
bit fifo_empty, fifo_full; // FIFO status flags
mailbox #(DataType) FIFO = new(FifoSize); // FIFO is bounded mailbox
function automatic void Write (input DataType write_data);
void'(FIFO.tryput(write_data)); // nonblocking write
fifo_full = ~(FIFO.num < FifoSize);
endfunction
function automatic void Read (output DataType read_data);
fifo_empty = (FIFO.num == 0);
void'(FIFO.tryget(read_data) ); // nonblocking read
endfunction
modport sender (input write_data, // sending module's connections
output fifo_full,
import Write);
modport reader (output read_data, // reading module's connections
output fifo_empty,
import Read);
endinterface: fifo_channel_1