Skip to content

Commit 1b238ad

Browse files
committed
Pdcp: getOrCreateRxEntity()getOrCreateTxEntity(): factor out module type into parameter, delete method overrides
TWO FINGERPRINT MISMATCHES: test_numerology, test_tdd
1 parent 0bcb038 commit 1b238ad

13 files changed

Lines changed: 27 additions & 134 deletions

src/simu5g/stack/pdcp/LtePdcp.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ void LtePdcpBase::initialize(int stage)
322322
streamingRlc_ = aToRlcType(par("streamingRlc"));
323323
backgroundRlc_ = aToRlcType(par("backgroundRlc"));
324324

325+
const char *rxEntityModuleTypeName = par("rxEntityModuleType").stringValue();
326+
rxEntityModuleType_ = cModuleType::get(rxEntityModuleTypeName);
327+
328+
const char *txEntityModuleTypeName = par("txEntityModuleType").stringValue();
329+
txEntityModuleType_ = cModuleType::get(txEntityModuleTypeName);
330+
325331
// TODO WATCH_MAP(gatemap_);
326332
WATCH(headerCompressedSize_);
327333
WATCH(nodeId_);
@@ -354,8 +360,7 @@ LteTxPdcpEntity *LtePdcpBase::getOrCreateTxEntity(MacCid cid)
354360
// FIXME HERE
355361

356362
buf << "LteTxPdcpEntity cid: " << cid.asPackedInt();
357-
cModuleType *moduleType = cModuleType::get("simu5g.stack.pdcp.LteTxPdcpEntity");
358-
LteTxPdcpEntity *txEnt = check_and_cast<LteTxPdcpEntity *>(moduleType->createScheduleInit(buf.str().c_str(), this));
363+
LteTxPdcpEntity *txEnt = check_and_cast<LteTxPdcpEntity *>(txEntityModuleType_->createScheduleInit(buf.str().c_str(), this));
359364
txEntities_[cid] = txEnt; // Add to entities map
360365

361366
EV << "LtePdcpBase::getTxEntity - Added new TxPdcpEntity for Cid: " << cid << "\n";
@@ -378,9 +383,8 @@ LteRxPdcpEntity *LtePdcpBase::getOrCreateRxEntity(MacCid cid)
378383
// Not found: create
379384

380385
std::stringstream buf;
381-
buf << "LteTxPdcpEntity Cid: " << cid.asPackedInt();
382-
cModuleType *moduleType = cModuleType::get("simu5g.stack.pdcp.LteRxPdcpEntity");
383-
LteRxPdcpEntity *rxEnt = check_and_cast<LteRxPdcpEntity *>(moduleType->createScheduleInit(buf.str().c_str(), this));
386+
buf << "RxPdcpEntity Cid: " << cid.asPackedInt();
387+
LteRxPdcpEntity *rxEnt = check_and_cast<LteRxPdcpEntity *>(rxEntityModuleType_->createScheduleInit(buf.str().c_str(), this));
384388
rxEntities_[cid] = rxEnt; // Add to entities map
385389

386390
EV << "LtePdcpBase::getRxEntity - Added new RxPdcpEntity for Cid: " << cid << "\n";

src/simu5g/stack/pdcp/LtePdcp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ class LtePdcpBase : public cSimpleModule
109109
// Identifier for this node
110110
MacNodeId nodeId_;
111111

112+
// Module type for creating RX/TX PDCP entities
113+
cModuleType *rxEntityModuleType_ = nullptr;
114+
cModuleType *txEntityModuleType_ = nullptr;
115+
112116
cGate *dataPortInGate_ = nullptr;
113117
cGate *dataPortOutGate_ = nullptr;
114118
cGate *tmSapInGate_ = nullptr;

src/simu5g/stack/pdcp/LtePdcpBase.ned

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ simple LtePdcpBase like ILtePdcp
3030
string streamingRlc @enum(TM,UM,AM,UNKNOWN_RLC_TYPE) = default("UM");
3131
string interactiveRlc @enum(TM,UM,AM,UNKNOWN_RLC_TYPE) = default("UM");
3232
string backgroundRlc @enum(TM,UM,AM,UNKNOWN_RLC_TYPE) = default("UM");
33+
string rxEntityModuleType = default("simu5g.stack.pdcp.LteRxPdcpEntity");
34+
string txEntityModuleType = default("simu5g.stack.pdcp.LteTxPdcpEntity");
3335

3436
//# Statistics
3537
@signal[receivedPacketFromUpperLayer];

src/simu5g/stack/pdcp/LtePdcpEnb.ned

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ package simu5g.stack.pdcp;
2121
simple LtePdcpEnb extends LtePdcpBase
2222
{
2323
@class("LtePdcpEnb");
24+
rxEntityModuleType = default("simu5g.stack.pdcp.LteRxPdcpEntity");
25+
txEntityModuleType = default("simu5g.stack.pdcp.LteTxPdcpEntity");
2426
}
2527

2628

src/simu5g/stack/pdcp/LtePdcpEnbD2D.ned

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ package simu5g.stack.pdcp;
2020
simple LtePdcpEnbD2D extends LtePdcpEnb
2121
{
2222
@class("LtePdcpEnbD2D");
23+
rxEntityModuleType = default("simu5g.stack.pdcp.LteRxPdcpEntity");
24+
txEntityModuleType = default("simu5g.stack.pdcp.LteTxPdcpEntity");
2325
}
2426

src/simu5g/stack/pdcp/LtePdcpUe.ned

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ package simu5g.stack.pdcp;
1919
simple LtePdcpUe extends LtePdcpBase
2020
{
2121
@class("LtePdcpUe");
22+
rxEntityModuleType = default("simu5g.stack.pdcp.LteRxPdcpEntity");
23+
txEntityModuleType = default("simu5g.stack.pdcp.LteTxPdcpEntity");
2224
}
2325

src/simu5g/stack/pdcp/LtePdcpUeD2D.ned

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ simple LtePdcpUeD2D extends LtePdcpUe
2020
{
2121
parameters:
2222
@class("LtePdcpUeD2D");
23+
rxEntityModuleType = default("simu5g.stack.pdcp.LteRxPdcpEntity");
24+
txEntityModuleType = default("simu5g.stack.pdcp.LteTxPdcpEntity");
2325
}
2426

src/simu5g/stack/pdcp/NrPdcpEnb.cc

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -124,56 +124,6 @@ MacNodeId NrPdcpEnb::getDestId(inet::Ptr<FlowControlInfo> lteInfo)
124124
return destId;
125125
}
126126

127-
LteTxPdcpEntity *NrPdcpEnb::getOrCreateTxEntity(MacCid cid)
128-
{
129-
// Find entity for this CID
130-
PdcpTxEntities::iterator it = txEntities_.find(cid);
131-
if (it == txEntities_.end()) {
132-
// Not found: create
133-
134-
std::stringstream buf;
135-
buf << "NRTxPdcpEntity Cid: " << cid.asPackedInt();
136-
cModuleType *moduleType = cModuleType::get("simu5g.stack.pdcp.NrTxPdcpEntity");
137-
NrTxPdcpEntity *txEnt = check_and_cast<NrTxPdcpEntity *>(moduleType->createScheduleInit(buf.str().c_str(), this));
138-
txEntities_[cid] = txEnt; // Add to entities map
139-
140-
EV << "NrPdcpEnb::getEntity - Added new PdcpEntity for Cid: " << cid << "\n";
141-
142-
return txEnt;
143-
}
144-
else {
145-
// Found
146-
EV << "NrPdcpEnb::getEntity - Using old PdcpEntity for Cid: " << cid << "\n";
147-
148-
return it->second;
149-
}
150-
}
151-
152-
LteRxPdcpEntity *NrPdcpEnb::getOrCreateRxEntity(MacCid cid)
153-
{
154-
// Find entity for this CID
155-
PdcpRxEntities::iterator it = rxEntities_.find(cid);
156-
if (it == rxEntities_.end()) {
157-
// Not found: create
158-
159-
std::stringstream buf;
160-
buf << "NRRxPdcpEntity Cid: " << cid.asPackedInt();
161-
cModuleType *moduleType = cModuleType::get("simu5g.stack.pdcp.NrRxPdcpEntity");
162-
LteRxPdcpEntity *rxEnt = check_and_cast<LteRxPdcpEntity *>(moduleType->createScheduleInit(buf.str().c_str(), this));
163-
rxEntities_[cid] = rxEnt; // Add to entities map
164-
165-
EV << "NrPdcpEnb::getRxEntity - Added new RxPdcpEntity for Cid: " << cid << "\n";
166-
167-
return rxEnt;
168-
}
169-
else {
170-
// Found
171-
EV << "NrPdcpEnb::getRxEntity - Using old RxPdcpEntity for Cid: " << cid << "\n";
172-
173-
return it->second;
174-
}
175-
}
176-
177127
void NrPdcpEnb::forwardDataToTargetNode(Packet *pkt, MacNodeId targetNode)
178128
{
179129
EV << NOW << " NrPdcpEnb::forwardDataToTargetNode - Send PDCP packet to node with id " << targetNode << endl;

src/simu5g/stack/pdcp/NrPdcpEnb.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,6 @@ class NrPdcpEnb : public LtePdcpEnbD2D
6161

6262
MacNodeId getDestId(inet::Ptr<FlowControlInfo> lteInfo) override;
6363

64-
/**
65-
* getEntity() is used to gather the NR PDCP entity
66-
* for that LCID. If the entity was already present, a reference
67-
* is returned; otherwise, a new entity is created,
68-
* added to the entities map and a reference is returned as well.
69-
*
70-
* @param lcid Logical CID
71-
* @return Pointer to the PDCP entity for the LCID of the flow
72-
*
73-
*/
74-
LteTxPdcpEntity *getOrCreateTxEntity(MacCid lcid) override;
75-
LteRxPdcpEntity *getOrCreateRxEntity(MacCid cid) override;
76-
7764
/*
7865
* Dual Connectivity support
7966
*/

src/simu5g/stack/pdcp/NrPdcpEnb.ned

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ simple NrPdcpEnb extends LtePdcpEnbD2D
2222
parameters:
2323
@class("NrPdcpEnb");
2424
string dualConnectivityManagerModule = default("^.dualConnectivityManager");
25+
rxEntityModuleType = default("simu5g.stack.pdcp.NrRxPdcpEntity");
26+
txEntityModuleType = default("simu5g.stack.pdcp.NrTxPdcpEntity");
2527
}
26-
27-
28-

0 commit comments

Comments
 (0)