Encore SIM EDITOR SOFTWARE Guide de l'utilisateur Page 100

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 149
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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]
Vue de la page 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 148 149

Commentaires sur ces manuels

Pas de commentaire