Skip to content
Snippets Groups Projects
Commit 21fe9b44 authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

processed review comments

parent eab1704f
No related branches found
No related tags found
1 merge request!382Resolve HPR-150
Pipeline #73288 passed
# ##########################################################################
# Copyright 2024
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ##########################################################################
# Author:
# . Reinier vd Walle
#
# Purpose:
# . Provide abstraction layer for using DP bus (sosi/siso) in cocotb.
#
# Description:
# . This file contains classes to create an abstraction layer for
# interacting with DP sosi/siso signals in cocotb testbenches.
# . The classes are copied from AvalonSTPkts in [1] and slightly adapted to
# use sosi/siso signals
#
# References:
# [1] - https://docs.cocotb.org/en/v1.5.1/_modules/cocotb_bus/drivers/avalon.html
# ##########################################################################
from typing import Iterable, Union, Optional from typing import Iterable, Union, Optional
import cocotb import cocotb
...@@ -8,8 +40,6 @@ from cocotb.result import TestError ...@@ -8,8 +40,6 @@ from cocotb.result import TestError
from cocotb_bus.drivers import ValidatedBusDriver from cocotb_bus.drivers import ValidatedBusDriver
from cocotb_bus.monitors import BusMonitor from cocotb_bus.monitors import BusMonitor
# Note: Copied from AvalonSTPkts in [1] and slightly adapted to use sosi/siso signals
# [1] - https://docs.cocotb.org/en/v1.5.1/_modules/cocotb_bus/drivers/avalon.html
class SosiDriver(ValidatedBusDriver): class SosiDriver(ValidatedBusDriver):
_optional_signals = ['valid', 'sop', 'eop', 'sync', 'bsn', 'data', 're', 'im', 'empty', 'channel', 'err'] _optional_signals = ['valid', 'sop', 'eop', 'sync', 'bsn', 'data', 're', 'im', 'empty', 'channel', 'err']
_signals = [] _signals = []
......
# ##########################################################################
# Copyright 2024
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ##########################################################################
# Author:
# . Reinier vd Walle
#
# Purpose:
# . Provide abstraction layer for using MM bus (copi/cipo) in cocotb.
#
# Description:
# . This file contains classes to create an abstraction layer for
# interacting with MM copi/cipo signals in cocotb testbenches.
# . The classes are copied from AvalonMM in [1] and slightly adapted to
# use copi/cipo signals
#
# References:
# [1] - https://docs.cocotb.org/en/v1.5.1/_modules/cocotb_bus/drivers/avalon.html
# ##########################################################################
from cocotb.log import SimLog from cocotb.log import SimLog
from cocotb.triggers import RisingEdge, ReadOnly from cocotb.triggers import RisingEdge, ReadOnly
from cocotb.binary import BinaryValue from cocotb.binary import BinaryValue
...@@ -5,8 +37,6 @@ from cocotb.result import TestError ...@@ -5,8 +37,6 @@ from cocotb.result import TestError
from cocotb_bus.drivers import BusDriver from cocotb_bus.drivers import BusDriver
from cocotb.decorators import coroutine from cocotb.decorators import coroutine
# Note: Copied from AvalonMM in [1] and slightly adapted to use copi/cipo signals
# [1] - https://docs.cocotb.org/en/v1.5.1/_modules/cocotb_bus/drivers/avalon.html
class CopiDriver(BusDriver): class CopiDriver(BusDriver):
_signals = [] _signals = []
_optional_signals = ["rd", "wr", "wrdata", "address"] _optional_signals = ["rd", "wr", "wrdata", "address"]
......
# ##########################################################################
# Copyright 2024
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ##########################################################################
# Author:
# . Reinier vd Walle
#
# Purpose:
# . Test the rdma_packetiser HDL dut using cocotb.
#
# Description:
# The testbench performs the following actions
# . Write and read/verify the rdma_packetiser configuration and header values over MM.
# . Send a set of DP packets containing just data (no headers).
# . Verify the output DP packets, the following parts of the packet is verified.
# . Packet header (ETH + IP + UDP + RDMA)
# . Packet payload (should be identical to the input data)
# . RDMA icrc value
#
# Usage:
# . do tb_rdma_packetiser.do
# . as 5
# . run -all
# ##########################################################################
from zlib import crc32 from zlib import crc32
import cocotb import cocotb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment