GENPAT(1)

πŸ“¦ version 5.1.1, in fedora 43, fedora 44

πŸ’– GENPAT(1) β€” the genpat glow-up πŸ’–

okay bestie, sit down, grab your boba, because we're about to talk about genpat β€” a procedural pattern file generator, and honestly? she's that girl. this is the ALLIANCE USER COMMANDS manual, and it's giving "I know C and I'm not afraid to use it." πŸŽ€


✨ NAME ✨

genpat β€” a procedural pattern file generator. yes that's it. short, sweet, iconic. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

genpat [-v] [-k] [file]

literally three little things and she's ready to serve. 🫢


🌸 ORIGIN 🌸

so this software belongs to the ALLIANCE CAD SYSTEM, developed by the ASIM team at the LIP6 laboratory of UniversitΓ© Pierre et Marie CURIE, in Paris, France. oui oui, Paris. trΓ¨s main character. πŸ₯βœ¨


πŸ‘‘ DESCRIPTION πŸ‘‘

Genpat is a set of C fonctions (yes, fonctions, we're being fancy) that lets you write a procedural description of an input pattern file for the logic simulator ASIMUT. the Unix genpat command takes a C file as input and produces a pattern description file as output.

🚨 bestie listen: the extension ".c" is not to be given. do NOT hand her the .c. just don't.

the file generated by genpat is in pat format, so IT IS STRONGLY RECOMMENDED TO SEE pat(5) BEFORE THIS MANUAL. like, no cap, go read pat(5) first. this is your vibe check. 🌈


πŸ’… OPTIONS πŸ’…

  • -v β€” verbose mode. she talks more. we love a chatty queen.
  • -k β€” keeps the executable along with the compilation Makefile after completion. she doesn't clean up after herself, and honestly? respect.

🧚 GENPAT FILE FORMAT 🧚

from a user point of view, genpat is a pattern description language using all standard C facilities (include, define, variables, loop, ...). the fonctions provided by genpat are to be used in a given order. using them in a different order won't crash the system, but will result in execution errors 😭 β€” so like, follow the choreography, bestie. here follows the description of the input file.

a pat format file can be divided in two parts: declaration and description part.

the declaration part is the list of inputs, outputs, internal signals and registers. inputs are to be forced to a certain value and all the others are to be observed during simulation. πŸ‘€

the description part is a set of patterns, where each pattern defines the value of inputs and outputs. the pattern number represents actually the absolute time for the simulator. ⏰

similarly, a genpat file can be divided in two parts: declaration and description part. functions related to the declaration must be called before any function related to the description part. order matters. periodt.

πŸŽ€ declaration part πŸŽ€

the first thing you should do in this part is to give the output file's name (see DEF_GENPAT(3)). then, this part allows you to declare the inputs, the outputs, and internal observing points (see DECLAR(3)). it is also possible to create virtual arraies (see ARRAY(3)). ✨

🌷 description part 🌷

after all signals are declared, you can begin to define input values which are to be applied to the inputs of the circuit, or output values which are to be compare with the values produced during the simulation. (see AFFECT(3)). Genpat describes the stimulus by event: only signal transitions are described. this part also allows you to give instructions to the simulation tool to save the state of the circuit at the end of the simulation. (see SAVE(3)). last thing you should do in this part is to generate the output file (see SAV_GENPAT(3)). 🫑


⭐ FUNCTIONS ⭐

  • DEF_GENPAT() β€” defines the output file's name.
  • SAV_GENPAT() β€” make the output file be generated.
  • DECLAR() β€” declares inputs, outputs, and the internal observing points.
  • ARRAY() β€” allows signals of the same type to be groupped in an "virtual array" in order to ease their manipulation.
  • INIT() β€” changes the values of registers between two patterns.
  • AFFECT() β€” assigns a value to a signal, at a given pattern number. this value is kept on the signal until a new value is assigned to the signal.
  • SAVE() β€” informs the simulation tool to save the state of the circuit at the end of simulation.
  • LABEL() β€” gives a label to the current pattern.
  • GETCPAT() β€” return the number of the current pattern.

πŸ”₯ EXAMPLES πŸ”₯

okay here's the whole serve, verbatim, do not touch:

#include <stdio.h>
#include "genpat.h"

char *inttostr(entier)
int entier;
  {
  char *str;
  str = (char *) mbkalloc (32 * sizeof (char));
  sprintf (str, "%d",entier);
  return(str);
  }
   /*------------------------------*/
   /* end of the description       */
   /*------------------------------*/

 main ()
 {
 int i;
 int j;
 int cur_vect = 0;

 DEF_GENPAT("example");

 /* interface */
 DECLAR ("a", ":2", "X", IN, "3  downto 0", "" );
 DECLAR ("b", ":2", "X", IN, "3  downto 0", "" );
 DECLAR ("s", ":2", "X", OUT, "3 downto 0", "" );
 DECLAR ("vdd", ":2", "B", IN, "", "" );
 DECLAR ("vss", ":2", "B", IN, "", "" );

 LABEL ("adder");
 AFFECT ("0", "vdd", "0b1");
 AFFECT ("0", "vss", "0b0");

 for (i=0; i<16; i++)
 {
     for (j=0; j<16; j++)
     {
         AFFECT (inttostr(cur_vect), "a", inttostr(i) );
         AFFECT (inttostr(cur_vect), "b", inttostr(j) );
         cur_vect++;
     }
 }

 SAV_GENPAT ();
 }

no notes. she ate. πŸ’–


πŸ“ ENVIRONMENT VARIABLES πŸ“

Genpat reads the environment variable VH_PATSFX to give the result file an extension. that's her little accessory. πŸŽ€


🌈 SEE ALSO 🌈

AFFECT(3), ARRAY(3), DECLAR(3), DEF_GENPAT(3), GETCPAT(3), INIT(3), LABEL(3), SAVE(3), SAV_GENPAT(3), pat(5), asimut(1)

go read them. iykyk. πŸ“šβœ¨


πŸ’€ BUG REPORT πŸ’€

this tool is under development at the ASIM department of the LIP6 laboratory. we need your feedback to improve documentation and tools. so like, tell them what's broken bestie, they're literally asking πŸ™ˆπŸ«Ά


and that's the whole manual, mwah. this page came from ASIM/LIP6, dated October 1, 1997 β€” yeah, 1997, a vintage icon, older than most of us but still slaying. bye bestie, go declare some signals πŸ’œβœ¨