• 大小: 4.02MB
    文件类型: .gz
    金币: 1
    下载: 0 次
    发布日期: 2023-09-15
  • 语言: 其他
  • 标签: uvm  sv  

资源简介

uvm_ref_flow_2013.05,cadence最新的UVMdemo

资源截图

代码片段和文件信息

/*=======================================================================*/
/* Generate ROM from S-Format (4K byte)                                  */
/*-----------------------------------------------------------------------*/
/* Rev.1 August    142002 by Thorn Aitch                                */
/* Rev.2 September 222002 by Thorn Aitch : Modify Verilog Descriptions  */
/* Rev.3 October   072002 by Thorn Aitch : 4K byte version              */
/* Rev.4 January   212003 by Thorn Aitch : 8K byte + RAM signals        */
/*                                                                       */
/*(1) Usage:                                                             */
/*    genrom filename vfile datfile                                      */
/*        [filename]  : (Input ) Binary File Name of Motolora S-Format.  */
/*        vfile       : (Output) Verilog ROM description.                */
/*        datfile     : (Output) ROM data file.                          */
/*                                                                       */
/*(2) ROM Specification:                                                 */
/*    8192 byte (32bit x 2048word) : address = 00000000~00001FFF         */
/*=======================================================================*/

#include 
#include 
#include 
#include 

#define ROMSIZE 32768 /* unit : byte */
#define MAXLINE 1000
#define MAXWORD 100


/*=============*/
/* main routine*/
/*=============*/
int main(int argc char *argv[])
{
FILE *memFp;
FILE *romvFp;
FILE *romdFp;
char memLine[MAXLINE];
char hex[MAXWORD];
char *pMemLine *pHex *SkipSpace();
int i errStx recType numCode;
unsigned long rom[ROMSIZE];
unsigned long addr;
unsigned long data;

if (argc != 5)
{

  printf(“\n“);
printf(“====================================\n“);
printf(“==== Generate ROM from S-Format ====\n“);
printf(“====================================\n“);
printf(“[Command Usage]\n“);
printf(“    genrom filename vfile datfile\n“);
printf(“\n“);
printf(“        [filename] : (input ) Binary File Name of Motorola S-Format.\n“);
printf(“        vfile      : (output) Verilog ROM description.\n“);
printf(“        datfile    : (output) ROM data file for $readmemh.\n“);
printf(“        module_nm  : verilog module name of the rom.\n“);
printf(“\n“);
printf(“[ROM Specification]\n“);
printf(“    -32768 byte (32bit x 8192word)\n“);
printf(“    -module rom(CLK CE WE SEL ADR DATI DATO);\n“);
printf(“        input  CLK;         : clock\n“);
printf(“        input  CE;          : chip enable\n“);
        printf(“        input  WE;          : write enable (ignored)\n“);
        printf(“        input  [ 3:0] SEL;  : byte lane (ignored)\n“);
printf(“        input  [14:0] ADR;  : address input\n“);
        printf(“        input  [31:0] DATI; : data input (ignored)\n“);
printf(“        output [31:0] DATO; : data output\n“);
printf(“    -

评论

共有 条评论