Specman - error while connecting the monitor to scoreboard - verification

I am using e (specman) in my project.
I build verification environment for uart.
I have a struct which is like any_sequence_item named uart_frame_s.
I want to add scoreboard for the tx in the uart.
I have the following instance in the uart_tx_agent:
uart_monitor: uart_tx_monitor_u is instance;
Definition of the scoreboard:
unit uart_tx_scoreboard_u like uvm_scoreboard{
scbd_port frame_add : add uart_frame_s;
scbd_port frame_match : match uart_frame_s;
};
I try to connect by:
connect_ports() is also {
uart_monitor.uart_frame_s_started.connect(tx_scb.uart_frame_s_add);
uart_monitor.uart_frame_s_ended.connect(tx_scb.uart_frame_s_match);
};
where:
uart_scb (scoreboard) is instance in uart_tx_agent
Definition of the TLM ports in the monitor:
uart_frame_s_started : out iterface_port of tlm_analysis of uart_frame_s is instance;
uart_frame_s_ended : out iterface_port of tlm_analysis of uart_frame_s is instance;
I get the following errors:
Error: 'uart_monitor' (of 'uart_tx_monitor_u') does not have 'uart_frame_S_started'field....
Error: 'uart_monitor' (of 'uart_tx_monitor_u') does not have 'uart_frame_S_ended'field

from the information that you have provided above, I can conclude the following:
1.the e scoreboard comes with predefined TLM implementation ports that you need to connect the monitor TLM output ports to.It seems like you did not define the TLM ports in your monitor. Pleas define those TLM ports as they are required when connecting to the scoreboard (there are examples for that in the scoreboard documentation).
What I suggest is that as soon as you finish collecting the frame from the bus , emit an event that notifies that a frame was completed (I guess you can call it "uart_frame_s_endded" ), then upon that event emit , send the collected frame to the scoreboard through the Monitor's TLM output ports for add/match. ( I guess 'add' would be appropriate for UART tx).
if the ports are defined, make sure to use the connect_portS() function in a place in the code that the parser will read later than the port definition.
just an FYI:
it seems like you defined the scoreboard from within the Agent. (seems like tx_scbd and uart_monitor are under the same hierarchy.
It is considered 'bad practice' to put a system level component (scoreboard) inside an uVC (which in this case is a UART interface component).
hopw this helps

Related

Can an end point is connected to more than one router in a NoC topology in gem5 garnet3.0?

I am running gem5 version 22.0.0.2. I operate Garnet in a standalone manner in conjunction with the Garnet Synthetic Traffic injector. I want to emulate a routerless NoC so I guess I need to connect an end point (e.g, Cores, Caches, Directories) to more than one "local" router. I just use a python configuration to configure the topology. But when I do this, there is a runtime error:
build/NULL/mem/ruby/network/garnet/GarnetNetwork.cc:125: info: Garnet version 3.0
build/NULL/base/stats/group.cc:121: panic: panic condition statGroups.find(name) != statGroups.end() occurred: Stats of the same group share the same name `power_state`.
Memory Usage: 692360 KBytes
Program aborted at tick 0
Here is a description from the gem5 documentation: "Each network interface is connected to one or more “local” routers which is could be connected through an “External” link." Here is the link:https://www.gem5.org/documentation/general_docs/ruby/heterogarnet/
Here is the constructor of Stats::Group
Group(Group *parent, const char *name = nullptr)
Here is a description from the gem5 documentation: "there are special cases where the parent group may be null. One such special case is SimObjects where the Python code performs late binding of the group parent."
Here is the link:https://www.gem5.org/documentation/general_docs/statistics/api.
I guess the error may be related to this, but I don't know the exact reason.
Any help would be appreciated.
Thank you.

What does RHPort mean in tinyusb?

Looking through tinyusb, am a bit confused on the meaning of RHPort - cannot find much on Internet, grepping through source gives me results like:
tinyusb/docs/info/changelog.rst:- Add rhport to hcd_init()
tinyusb/docs/info/changelog.rst: - Support multiple usb ports with rhport=1 is high
...
tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h:// RHPort max operational speed can defined by board.mk
...
tinyusb/examples/device/cdc_dual_ports/src/tusb_config.h:// Device mode with rhport and speed defined by board.mk
...
tinyusb/examples/device/cdc_msc/src/tusb_config.h:// RHPort number used for device can be defined by board.mk, default to port 0
...
... and trying to think of what could "RH" possibly stand for as an acronym, the only thing that pops in my head is "Right Honourable" :)
So, what is the meaning of RHPort in (tiny)USB?
Ok, I think I found at least some sort of an explanation ...
Anyways, https://docs.tinyusb.org/en/latest/reference/getting_started.html says:
Port Selection
If a board has several ports, one port is chosen by default in the
individual board.mk file. Use option PORT=x To choose another port.
For example to select the HS port of a STM32F746Disco board, use:
$ make BOARD=stm32f746disco PORT=1 all
A bit tricky to find where that PORT is used, then - but for the above example, it is most likely in https://github.com/hathach/tinyusb/blob/master/hw/bsp/stm32f7/family.mk :
...
CFLAGS += \
...
-DBOARD_TUD_RHPORT=$(PORT)
...
... which then gets used in e.g. https://github.com/hathach/tinyusb/blob/master/examples/device/dfu_runtime/src/main.c :
...
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
...
... which reveals, that "RH" in "RHPort" most likely stands for "Root Hub".
So, my guess is, that for boards that have multiple physical USB port connectors, the RHPort determines which of those ports is tinyusb targeting?

How to configure TRF7970A to work in Special Direct Mode and Direct Mode 1?

I am using two msp430f5529 with booster pack(trf7970a),I'm making one module to work in special direct mode(as per sloa214,SDM is used to transmit data) and another one module to work in Direct Mode1(DM1) to receive transmitted data from module one. But I'm not able to receive any data.
Below is my tx code.
Mifare_SDM_config();
Mifare_SDM_Enter();
Mifare_SDM_Transmit((unsigned int*)tx_buff,10,1); //here 1 is parity bit
Mifare_SDM_Exit();
and my receiver code.
//Entering DM1 Mifare_DM1_Enter();
Mifare_DM1_Recieve(rx_buff,rx_len,1);//here 1 is parity bit
Mifare_DM1_Exit();
am I missing anything?

what are the purpose of `MLX4_EVENT_TYPE_COMP` and `MLX4_EVENT_TYPE_CMD` in mlnx-ofed-kernel-3.1 interrupt handler?

I'm using a mellanox Infiniband card MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE] with mlnx-ofed-kernel-3.1 on a linux kernel version 3.13.0.
When the card is connected to another one and configured (ibstat said both cards are active in the infiniband link layer), I experimented that every 9 seconds the card send 8 interrupts consisting of 4 pairs of event type MLX4_EVENT_TYPE_COMP and MLX4_EVENT_TYPE_CMD.
I also noticed that If I modify the function mlx4_interrupt code (which is the interrupt handler in the mlnx-ofed-kernel-3.1) to avoid it to handle those two interrupts events, the completion queues are immedialty destroy which directly cause further data transfers on the infiniband card to fail.
My question is what are the purpose of those interrupt events and MLX4_EVENT_TYPE_COMP and MLX4_EVENT_TYPE_CMD and why are they mandatory to keep queue pair available ?
Here are the codes called by each of those interrupt event in drivers/net/ethernet/mellanox/mlx4/eq.c
MLX4_EVENT_TYPE_COMP :
cqn = be32_to_cpu(eqe->event.comp.cqn) & 0xffffff;
mlx4_cq_completion(dev, cqn);
MLX4_EVENT_TYPE_CMD :
mlx4_cmd_event(dev, be16_to_cpu(eqe->event.cmd.token), eqe->event.cmd.status, be64_to_cpu(eqe->event.cmd.out_param));

atmel sensor using printf

I have an atmel UC3-L0 and compass sensor. Now I install AtmelStudio and download some demo code into the board. But I have no idea where the function printf in demo code will appear the data. How should I do to get the data?
The printf function outputs to stdout.
Usually on a "naked" processor with no operating system you need to define how a character is sent or received from a physical interface (usually an USART, console port, USB port, 4-port LCD interface, etc.). So typically you may want to use the USART port of your processor board to connect to a PC running Hyperterm, PuTTY or similar using a serial cable.
In essence you will need to
create FILE streams using the fdev_setup_stream() macro and
provide pointers to functions get() and put() that tell the printf() function how exactly to read and write from/to that stream (e.g. read/write to a USART, an LCD display, etc.).
you may have libraries - depending on your hardware - that already contain such functions (plus the correct port initialisation functions), like e.g. uart.c/.h, lcd.c/.h, etc.
In the documentation of stdio.h (e.g. here) look for the following:
printf(), fdev_setup_stream()
If you have downloaded Atmel Studio you may look into the stdiodemo.c code for further insight.
In order to use printf in ATMEL studio you should check the following things:
Add and Apply the Standard serial I/O module from Project->ASF Wizard.
Also add the USART module from the ASF Wizard.
Include the following code snippet before the main function.
static struct usart_module usart_instance;
static void configure_console(void)
{
struct usart_config usart_conf;
usart_get_config_defaults(&usart_conf);
usart_conf.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING;
usart_conf.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0;
usart_conf.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1;
usart_conf.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2;
usart_conf.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3;
usart_conf.baudrate = 115200;
stdio_serial_init(&usart_instance, EDBG_CDC_MODULE, &usart_conf);
usart_enable(&usart_instance);
}
Make Sure you call the configure_console after system_init() from the main function.
Now go to tools->extension manager. Add the terminal window extension.
Build and Run your program and open the terminal window from view-> terminal window. put the correct com port to which your device is running on and set the baud to 115200 and hit connect on the terminal window.
You should see the printf statements now. (Float doesn't get printed in Atmel studio)
I was recently puzzling over this myself. I has installed Atmel Studio 7.0 and was using the SAMD21 Dev Board via an example project in which a call to printf was made.
In the sample code I saw that there was a configuration section:
/*!
* \brief Initialize USART to communicate with on board EDBG - SERCOM
* with the following settings.
* - 8-bit asynchronous USART
* - No parity
* - One stop bit
* - 115200 baud
*/
static void configure_usart(void)
{
struct usart_config config_usart;
// Get the default USART configuration
usart_get_config_defaults(&config_usart);
// Configure the baudrate
config_usart.baudrate = 115200;
// Configure the pin multiplexing for USART
config_usart.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING;
config_usart.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0;
config_usart.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1;
config_usart.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2;
config_usart.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3;
// route the printf output to the USART
stdio_serial_init(&usart_instance, EDBG_CDC_MODULE, &config_usart);
// enable USART
usart_enable(&usart_instance);
}
In windows device manager I saw that there was an "Atmel Corp. EDBG USB Port (COM3)" listed under "Ports". However, the one of the "Properties" of this port was listed as 9600 Bits per second. I changed this from 9600 to 115200 to be consistent with the config section above.
Finally, I ran PuTTY.exe and set the Connection-->Serial setting to COM3 and 115200 baud. Then I went to Session, then clicked the Serial Connection Type, then clicked the Open button. And, BAM, there's my printf output via PuTTY.