Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt agent : Modify README also clean interrupt_pkg #2571

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions verif/env/uvme/uvma_interrupt/README.md

This file was deleted.

Binary file added verif/env/uvme/uvma_interrupt/docs/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
167 changes: 167 additions & 0 deletions verif/env/uvme/uvma_interrupt/docs/interrupt_agent_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#Interrupt Agent documentation

<!---
Copyright 2024 Thales DIS SAS

Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
You may obtain a copy of the License at https://solderpad.org/licenses/

Original Author: Ayoub JALALI ([email protected]) – sub-contractor MU-Electronics for Thales group

-->

## Contents

[1- Introduction](#introduction)

[2- Interrupt Agent architecture](#interrupt-agent-architecture)

[3- Supported features](#supported-features)

[4- Agent configuration Fields](#Agent-configuration-Fields)

[5- TestBench Integration](#testbench-integration)

[6- Sequences](#sequence)

[7- Checks](#checks)

[8- Packages dependencies](#packages-dependencies)

## Introduction

This document describes the interrupt agent that plays as a interrupt controler
for the CV32A65X, the agent is based on the following protocol:
<https://github.com/openhwgroup/cva6/blob/master/verif/docs/Protocols/interrupt-verification.adoc>

## Interrupt Agent architecture

![](image.png)

*Fig-1: Interrupt agent architecture*

The Interrupt agent provides following components:

- uvma_interrupt_agent_c: UVM Agent

- uvma_interrupt_mon_c: Agent monitor, collects and broadcast transactions to
the coverage model each time the interrupt interface changes.

- uvma_interrupt_base_seq_c: Base sequence, instantiate agent configuration & context,
and connect it with the sequencer configuration & context.

- uvma_interrupt_seq_c: Generates interrupt requests & clear them
based on the clear protocol decribe in link above.

- uvma_interrupt_seq_item_c: Have main items of an interrupt transaction,
`interrupt_vector, `interrupt_channel_mask and interrupt delays.

- uvma_interrupt_sqr_c: Sequencer, receives requests from
the sequence and send it to the driver.

- uvma_interrupt_drv_c: drive the vif with the requests received from
sequencer.

- uvma_interrupt_cntxt_c: Agent context, instantiate VIF uma_interrupt_intf and
memory uvml_mem. VIF and Memory are accessible in all components
through context.

- uvma_interrupt_cfg_c: Agent configuration, all available configuration
fields are described in Configuration Fields.

## Supported features

features are:

- **Asynchronous request::** the agent support Asynchronously interrupts requests.

- **No channel Dependency:** there's no dependency between the interrupt channels,
every one is managed independently.

- **Channel delay:** provide delay after setting the interrupt request,
also after clear it.

- **Randomize channel:** full randomization of setting interrupt request.

- **Timeout:** the agent is triggering a `UVM_FATAL` after a number of
clock cycle if it failed to clear the interrupt request.

## Agent configuration Fields

- **is_active**: Switch the agent mode to active. The agent support
only UVM_ACTIVE mode (can't be in passive mode).

- **trn_log_enabled**: Enabling interrupt transaction logger when 1.

- **enable_interrupt:** Enabling sending interrupt request when 1.

- **interrupt_plusarg_valid:** Enabling interrupts from commande line request when 1.

- **num_irq_supported**: Represent the number of interrupt channels supported.

- **irq_addr**: Represent the memory address used by the interrupt
clear mechanism.

- **enable_clear_irq**: Enabling the interrupt clear mechanism when 1.

- **irq_timeout**: Represent the number of clock cyle before the agent
trigger a `UVM_FATAL` timeout.

## TestBench Integration

In the sv testbench instantiate the VIF and connect it to the DUT
interface:

`uvma_interrupt_if interrupt_vif(
.clk(clknrst_if.clk),
.reset_n(clknrst_if.reset_n)
);`

//DUT connection

`.irq_i ( {1'b0, irq_i[0]} )`
`.ipi_i ( 1'b0 )`
`.time_irq_i ( irq_i[1] )`

Then set the VIF to agent instantiation in env:

`uvm_config_db#(virtual uvma_interrupt_if)::set(.cntxt(null), .inst_name("*"), .field_name("interrupt_vif"), .value(interrupt_vif));`

In env instantiate and create the Interrupt agent:

`uvma_interrupt_agent_c interrupt_agent;
`
`interrupt_agent = uvma_interrupt_agent_c::type_id::create("interrupt_agent",this);`

Instantiate, create and set the config to the agent:

`uvma_interrupt_cfg_c interrupt_cfg;`

`interrupt_cfg = uvma_interrupt_cfg_c::type_id::create("interrupt_cfg");`

`uvm_config_db#(uvma_interrupt_cfg_c)::set(this, "*interrupt_agent", "cfg",cfg.interrupt_cfg);`

## Sequences

This agent provides only one sequence:

1. Set/Clear sequence: this sequence set interrupt request also clear it
based on a protocol.

## Checks

No checks for now.

## Packages dependencies

This agent is dependent on the following UVM packages:

- uvm_pkg

- uvml_trn_pkg

- uvml_logs_pkg

- uvml_mem_pkg
2 changes: 0 additions & 2 deletions verif/env/uvme/uvma_interrupt/uvma_interrupt_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ package uvma_interrupt_pkg;
import uvml_hrtbt_pkg::*;
import uvml_trn_pkg ::*;
import uvml_logs_pkg ::*;
import uvma_isacov_pkg ::*;
import uvma_rvfi_pkg ::*;

parameter XLEN = 32;
parameter int MAX_ADDR_WIDTH = `UVMA_AXI_ADDR_MAX_WIDTH ; // subjective maximum
Expand Down
Loading