Encore SIM EDITOR SOFTWARE Guia do Utilizador Página 100

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 149
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 99
2-32
Modeling Your Design
2. A nested begin block executes only if the current scope is either
top.c1 or top.c3.
3. VCS displays whether $activeinst points to a zero or non-zero
value.
The C code is as follows:
#include <stdio.h>
void showInst(unsigned str_arg)
{
const char *str = (const char *)str_arg;
printf("DirectC: [%s]\n", str);
}
Function showInst declares the char pointer str and assigns to it
the value of its parameter, which is the pointer in $activeinst in
the Verilog code. Then with a printf statement it displays the
hierarchical name that str is pointing to. Notice that the function
begins the information it displays with DirectC: so that you can
differentiate it from what VCS displays.
During simulation VCS and the C function display the following:
DirectC: [top.c1]
for instance top.c1 the pointer is non-zero
DirectC: [top.c2]
DirectC: [top.c3]
for instance top.c3 the pointer is non-zero
DirectC: [top.c4]
Vista de página 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 148 149

Comentários a estes Manuais

Sem comentários