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

Subversion Repositories m1_core

[/] [m1_core/] [trunk/] [tools/] [bin/] [dump2vlog.php] - Rev 54

Compare with Previous | Blame | View Log

#!/usr/bin/php -q
<?php

  
// Open the stdin
  
$fp fopen("php://stdin""r");

  
// Start writing to stdout
  
echo("/* THIS FILE IS GENERATED AUTOMATICALLY BY THE compile_test SCRIPT */\n");

  
// Discard first lines
  
for($i=0$i<6$i++) fgets($fp);

  
// Print only the opcodes to stdout
  
$address 0;
  while (!
feof($fp)) {
    
$line fgets($fp);
    
$opcode substr($line68);
    if(
is_numeric("0x".$opcode)) {
      echo(
"MEM[$address] <= 32'h$opcode;\n");
      
$address++;
    }
  }

  
// Fill in the remaining empty locations
  
while($address<256) {
    echo(
"MEM[$address] <= 32'h00000000;\n");
    
$address++;
  }

  
// Close the input file
  
fclose($fp);

?>

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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