Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
86f8a9bb
Commit
86f8a9bb
authored
Feb 14, 2021
by
Antoine Kaufmann
Browse files
corundum,i40e_bm: remove old commeted out code
parent
8a874a8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
148 deletions
+4
-148
sims/nic/corundum/corundum_verilator.cc
sims/nic/corundum/corundum_verilator.cc
+4
-122
sims/nic/i40e_bm/rss.cc
sims/nic/i40e_bm/rss.cc
+0
-26
No files found.
sims/nic/corundum/corundum_verilator.cc
View file @
86f8a9bb
...
@@ -383,49 +383,6 @@ void pci_rwcomp_issue(MMIOOp *op) {
...
@@ -383,49 +383,6 @@ void pci_rwcomp_issue(MMIOOp *op) {
delete
op
;
delete
op
;
}
}
#if 0
class MemAccessor {
protected:
Vinterface ⊤
/* outputs to memory */
vluint8_t &p_mem_sel;
vluint32_t (*p_mem_be)[4]; /* for write only */
vluint32_t (&p_mem_addr)[3];
vluint8_t &p_mem_valid;
vluint8_t *p_mem_resp_ready; /* for read only */
/* direction depends */
vluint32_t (&p_mem_data)[32];
/* inputs from memory */
vluint8_t &p_mem_ready;
vluint8_t *p_mem_resp_valid; /* for read only */
public:
MemAccessor(Vinterface &top_, bool read,
vluint8_t &p_mem_sel_,
vluint32_t (*p_mem_be_)[4],
vluint32_t (&p_mem_addr_)[3],
vluint8_t &p_mem_valid_,
vluint8_t *p_mem_resp_ready_,
vluint32_t (&p_mem_data_)[32],
vluint8_t &p_mem_ready_,
vluint8_t *p_mem_resp_valid_)
: top(top_),
p_mem_sel(p_mem_sel_), p_mem_be(p_mem_be_), p_mem_addr(p_mem_addr_),
p_mem_valid(p_mem_valid_), p_mem_resp_ready(p_mem_resp_ready_),
p_mem_data(p_mem_data_), p_mem_ready(p_mem_ready_),
p_mem_resp_valid(p_mem_resp_valid_)
{
}
void step()
{
}
};
#endif
std
::
set
<
DMAOp
*>
pci_dma_pending
;
std
::
set
<
DMAOp
*>
pci_dma_pending
;
void
pci_dma_issue
(
DMAOp
*
op
)
{
void
pci_dma_issue
(
DMAOp
*
op
)
{
...
@@ -470,10 +427,10 @@ static void h2d_readcomp(volatile struct cosim_pcie_proto_h2d_readcomp *rc) {
...
@@ -470,10 +427,10 @@ static void h2d_readcomp(volatile struct cosim_pcie_proto_h2d_readcomp *rc) {
memcpy
(
op
->
data
,
(
void
*
)
rc
->
data
,
op
->
len
);
memcpy
(
op
->
data
,
(
void
*
)
rc
->
data
,
op
->
len
);
#if 0
#if 0
std::cerr << "dma read comp: ";
std::cerr << "dma read comp: ";
for (size_t i = 0; i < op->len; i++)
for (size_t i = 0; i < op->len; i++)
std::cerr << (unsigned) op->data[i] << " ";
std::cerr << (unsigned) op->data[i] << " ";
std::cerr << std::endl;
std::cerr << std::endl;
#endif
#endif
op
->
engine
->
pci_op_complete
(
op
);
op
->
engine
->
pci_op_complete
(
op
);
...
@@ -794,81 +751,6 @@ static void poll_n2d(EthernetRx &rx) {
...
@@ -794,81 +751,6 @@ static void poll_n2d(EthernetRx &rx) {
nicif_n2d_next
();
nicif_n2d_next
();
}
}
#if 0
class PCICoordinator {
protected:
struct PCIOp {
union {
DMAOp *dma_op;
uint32_t msi_vec;
};
bool isDma;
bool ready;
};
Vinterface ⊤
std::deque<PCIOp *> queue;
std::map<DMAOp *, PCIOp *> dmamap;
void process()
{
PCIOp *op;
while (queue.empty()) {
op = queue.front();
if (!op->ready)
break;
queue.pop_front();
if (!op->isDma) {
pci_msi_issue(op->msi_vec);
delete op;
} else {
pci_dma_issue(op->dma_op);
dmamap.erase(op->dma_op);
delete op;
}
}
}
public:
PCICoordinator(Vinterface &top_)
: top(top_)
{
}
void dma_register(DMAOp *dma_op, bool ready)
{
PCIOp *op = new PCIOp;
op->dma_op = vec;
op->isDma = true;
op->ready = ready;
queue.push_back(op);
dmamap[op] = dma_op;
process();
}
void dma_mark_ready(DMAOp *op)
{
dmamap[op]->ready = true;
process();
}
void msi_enqueue(uint32_t vec)
{
PCIOp *op = new PCIOp;
op->msi_vec = vec;
op->isDma = false;
op->ready = true;
queue.push_back(op);
process();
}
};
#endif
void
pci_msi_issue
(
uint8_t
vec
)
{
void
pci_msi_issue
(
uint8_t
vec
)
{
volatile
union
cosim_pcie_proto_d2h
*
msg
=
d2h_alloc
();
volatile
union
cosim_pcie_proto_d2h
*
msg
=
d2h_alloc
();
volatile
struct
cosim_pcie_proto_d2h_interrupt
*
intr
;
volatile
struct
cosim_pcie_proto_d2h_interrupt
*
intr
;
...
...
sims/nic/i40e_bm/rss.cc
View file @
86f8a9bb
...
@@ -87,29 +87,3 @@ uint32_t rss_key_cache::hash_ipv4(uint32_t sip, uint32_t dip, uint16_t sp,
...
@@ -87,29 +87,3 @@ uint32_t rss_key_cache::hash_ipv4(uint32_t sip, uint32_t dip, uint16_t sp,
return
res
;
return
res
;
}
}
#if 0
int main(int argc, char *argv[])
{
static const uint8_t key[] = {
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
uint32_t kregs[13];
key_cache kc(kregs);
memcpy(kregs, key, sizeof(key));
kc.set_dirty();
printf("%x\n", kc.hash_ipv4(0x420995bb, 0xa18e6450, 2794, 1766));
printf("%x\n", kc.hash_ipv4(0x420995bb, 0xa18e6450, 0, 0));
return 0;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment