samarth jain
10/10/2024, 5:42 PMMatt Venn
10/11/2024, 10:57 AMMatt Venn
10/11/2024, 10:57 AMsamarth jain
10/11/2024, 10:58 AMsamarth jain
10/11/2024, 12:39 PM# SPDX-FileCopyrightText: 2023 Efabless Corporation
# 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|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.
# SPDX-License-Identifier: Apache-2.0
from caravel_cocotb.caravel_interfaces import test_configure
from caravel_cocotb.caravel_interfaces import report_test
import cocotb
from cocotb.clock import Clock
#from cocotb.trigger import RisingEdge, ClockCycles
@cocotb.test()
@report_test
async def counter_wb(dut):
caravelEnv = await test_configure(dut,timeout_cycles=100000)
# To test & see if we can flip the gpios at all.
caravelEnv.drive_gpio_in((31,0),0xFFFFFFFF)
caravelEnv.drive_gpio_in((31,0),0x00000000)
# Generate a 2 GHz clock signal on a digital input pin (using gpio_0)
cocotb.log.info(f"[TEST] Starting 2 GHz clock on gpio_14")
clock = Clock(dut.gpio14, 0.5, units="ns") # 0.5 ns period = 2 GHz
await cocotb.start(clock.start())
cocotb.log.info(f"[TEST] Start counter_wb test")
# wait for start of sending
await caravelEnv.release_csb()
await caravelEnv.wait_mgmt_gpio(1)
cocotb.log.info(f"[TEST] finish configuration")
# Now wait util the mgmt gpio pin goes low again, so we know we reach the end of our firmware...
await caravelEnv.wait_mgmt_gpio(0)
Anton Maurovic (efabless support)
10/11/2024, 2:26 PMAnton Maurovic (efabless support)
10/11/2024, 2:33 PMsamarth jain
10/11/2024, 2:40 PMsamarth jain
10/11/2024, 2:42 PMclock = Clock(dut.gpio14, 0.5, units="ns") # 0.5 ns period = 2 GHz
I think the dut.gpio14 is the problem. Is there a way to see the dut variables available to interface with.samarth jain
10/11/2024, 2:53 PMAnton Maurovic (efabless support)
10/11/2024, 2:54 PMAnton Maurovic (efabless support)
10/11/2024, 2:55 PMsamarth jain
10/11/2024, 2:55 PMsamarth jain
10/11/2024, 2:56 PMAnton Maurovic (efabless support)
10/11/2024, 2:57 PMsamarth jain
10/11/2024, 2:59 PMAnton Maurovic (efabless support)
10/11/2024, 3:03 PMsamarth jain
10/11/2024, 3:04 PMAnton Maurovic (efabless support)
10/11/2024, 3:05 PMsamarth jain
10/11/2024, 3:05 PM