Skip to content

Commit 2c16f0b

Browse files
committed
misc: Replace packet with value
Since communications in SRNoC do not have headers & flits, values is the more accurate term.
1 parent a383268 commit 2c16f0b

File tree

8 files changed

+237
-237
lines changed

8 files changed

+237
-237
lines changed

src/network/Layer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class Layer(ClockedObject):
3737
# Vector of ports in the network
3838
buffered_ports = VectorParam.BufferedPort("I/O ports in the network")
3939

40-
# max_packets: 0 means not provided
41-
max_packets = Param.Int(
42-
-1, "Maximum number of packets to schedule; -1 means infinite"
40+
# max_values: 0 means not provided
41+
max_values = Param.Int(
42+
-1, "Maximum number of values to schedule; -1 means infinite"
4343
)
4444

4545
# schedule_path: empty string means not provided
@@ -58,7 +58,7 @@ class Layer(ClockedObject):
5858
-1, "Crosspoint setup time in picoseconds"
5959
)
6060
hold_time = Param.Float(-1, "Hold time in picoseconds")
61-
packets_per_port_per_window = Param.Int(1, "Packets per port per window")
61+
values_per_port_per_window = Param.Int(1, "Values per port per window")
6262

6363
cxx_exports = [
6464
PyBindMethod("setRandomTrafficMode"),

src/network/buffered_port.cc

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -58,46 +58,46 @@ BufferedPort::getAddr()
5858
return addr;
5959
}
6060

61-
// Assigns a packet to the port by pushing the dest address into queue
61+
// Assigns a value to the port by pushing the dest address into queue
6262
void
63-
BufferedPort::assignPacket(uint64_t dest_addr)
63+
BufferedPort::assignValue(uint64_t dest_addr)
6464
{
65-
packetQueue.push(dest_addr); // Queue the dest
65+
valueQueue.push(dest_addr); // Queue the dest
6666
DPRINTF(BufferedPort,
67-
"BufferedPort %d assigned packet "
67+
"BufferedPort %d assigned value "
6868
"to destination %d\n",
6969
addr, dest_addr
7070
);
7171
}
7272

73-
// Retrieves and removes the next packet from the queue
74-
// Returns 0 if no packets are available
73+
// Retrieves and removes the next value from the queue
74+
// Returns 0 if no values are available
7575
uint64_t
76-
BufferedPort::getNextPacket()
76+
BufferedPort::getNextValue()
7777
{
78-
if (!packetQueue.empty()) {
79-
// Get the next packet and remove it from the queue
80-
uint64_t nextPacket = packetQueue.front();
81-
packetQueue.pop();
82-
return nextPacket;
78+
if (!valueQueue.empty()) {
79+
// Get the next value and remove it from the queue
80+
uint64_t nextValue = valueQueue.front();
81+
valueQueue.pop();
82+
return nextValue;
8383
}
84-
return 0; // No packet available
84+
return 0; // No value available
8585
}
8686

87-
// Checks if there are any packets in the queue
87+
// Checks if there are any values in the queue
8888
bool
89-
BufferedPort::hasPackets() const
89+
BufferedPort::hasValues() const
9090
{
91-
return !packetQueue.empty();
91+
return !valueQueue.empty();
9292
}
9393

94-
// Increments the missed packet count
94+
// Increments the missed value count
9595
void
96-
BufferedPort::incrementMissedPackets()
96+
BufferedPort::incrementMissedValues()
9797
{
98-
missedPackets++;
99-
DPRINTF(BufferedPort, "BufferedPort %d missed packets: %d\n",
100-
addr, missedPackets
98+
missedValues++;
99+
DPRINTF(BufferedPort, "BufferedPort %d missed values: %d\n",
100+
addr, missedValues
101101
);
102102
}
103103

@@ -112,15 +112,15 @@ BufferedPort::receiveData(uint64_t received_data, uint64_t src_addr)
112112
lastReceivedFrom = src_addr; // Store the source of the data
113113
}
114114

115-
// Returns the next packet without removing it from the queue
116-
// Returns -1 if no packets are available
115+
// Returns the next value without removing it from the queue
116+
// Returns -1 if no values are available
117117
uint64_t
118-
BufferedPort::peekNextPacket() const
118+
BufferedPort::peekNextValue() const
119119
{
120-
if (!packetQueue.empty()) {
121-
return packetQueue.front();
120+
if (!valueQueue.empty()) {
121+
return valueQueue.front();
122122
}
123-
return -1; // No packet available
123+
return -1; // No value available
124124
}
125125

126126
} // namespace gem5

src/network/buffered_port.hh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ namespace gem5
3838
{
3939

4040
// The BufferedPort class represents a single node in the network
41-
// responsible for storing, sending, and receiving packets.
41+
// responsible for storing, sending, and receiving values.
4242
// It tracks its data, address, and maintains statistics for
43-
// sent and received packets.
43+
// sent and received values.
4444
class BufferedPort : public ClockedObject
4545
{
4646
private:
4747
// The address identifier of the port
4848
uint64_t addr;
4949

50-
// Queue to hold packets (destination addresses) assigned to the port
51-
std::queue<uint64_t> packetQueue;
50+
// Queue to hold values (destination addresses) assigned to the port
51+
std::queue<uint64_t> valueQueue;
5252

5353
// Variables to store the most recent received data and source addr
5454
uint64_t lastReceivedData = 0;
5555
uint64_t lastReceivedFrom = 0;
5656

57-
uint64_t missedPackets = 0; // Count of missed packets
57+
uint64_t missedValues = 0; // Count of missed values
5858

5959
public:
6060
// Constructor: Initializes the BufferedPort with parameters
@@ -66,30 +66,30 @@ class BufferedPort : public ClockedObject
6666
// Retrieves the address of the port
6767
uint64_t getAddr();
6868

69-
// Assigns a packet to the queue with the given destination address
70-
void assignPacket(uint64_t dest_addr);
69+
// Assigns a value to the queue with the given destination address
70+
void assignValue(uint64_t dest_addr);
7171

7272
// Receives data from another port
7373
// Stores the received value and source
7474
void receiveData(uint64_t received_data, uint64_t src_addr);
7575

76-
// Retrieves and removes the next packet from the queue
77-
uint64_t getNextPacket();
76+
// Retrieves and removes the next value from the queue
77+
uint64_t getNextValue();
7878

79-
// Checks if the port has any packets in its queue
80-
bool hasPackets() const;
79+
// Checks if the port has any values in its queue
80+
bool hasValues() const;
8181

8282
// Getters for the last received data and source information
8383
uint64_t getLastReceivedData() const { return lastReceivedData; }
8484
uint64_t getLastReceivedFrom() const { return lastReceivedFrom; }
8585

86-
// Getter for missed packets count
87-
uint64_t getMissedPackets() const { return missedPackets; }
88-
// Increments the missed packets count
89-
void incrementMissedPackets();
86+
// Getter for missed values count
87+
uint64_t getMissedValues() const { return missedValues; }
88+
// Increments the missed values count
89+
void incrementMissedValues();
9090

91-
// Peeks at the next packet without removing it from the queue
92-
uint64_t peekNextPacket() const;
91+
// Peeks at the next value without removing it from the queue
92+
uint64_t peekNextValue() const;
9393
};
9494

9595
} // namespace gem5

0 commit comments

Comments
 (0)