OpenCores
URL https://opencores.org/ocsvn/m1_core/m1_core/trunk

Subversion Repositories m1_core

[/] [m1_core/] [trunk/] [tools/] [bin/] [dump2vlog.php] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 41 fafa1971
#!/usr/bin/php -q
2
<?php
3
 
4
  // Open the stdin
5
  $fp fopen("php://stdin""r");
6
 
7
  // Start writing to stdout
8
  echo("/* THIS FILE IS GENERATED AUTOMATICALLY BY THE compile_test SCRIPT */\n");
9
 
10
  // Discard first lines
11
  for($i=0$i<6$i++) fgets($fp);
12
 
13
  // Print only the opcodes to stdout
14
  $address 0;
15
  while (!feof($fp)) {
16
    $line fgets($fp);
17
    $opcode substr($line68);
18
    if(is_numeric("0x".$opcode)) {
19
      echo("MEM[$address] <= 32'h$opcode;\n");
20
      $address++;
21
    }
22
  }
23
 
24
  // Fill in the remaining empty locations
25
  while($address<256) {
26
    echo("MEM[$address] <= 32'h00000000;\n");
27
    $address++;
28
  }
29
 
30
  // Close the input file
31
  fclose($fp);
32
 
33
?>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.