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

Subversion Repositories versatile_counter

[/] [versatile_counter/] [trunk/] [rtl/] [verilog/] [versatile_counter_generator.php] - Diff between revs 25 and 26

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 25 Rev 26
Line 72... Line 72...
echo "//////////////////////////////////////////////////////////////////////" PHP_EOL;
echo "//////////////////////////////////////////////////////////////////////" PHP_EOL;
 
 
echo PHP_EOL "// " $counter['type'] . " counter" PHP_EOL;
echo PHP_EOL "// " $counter['type'] . " counter" PHP_EOL;
echo "module " $counter['Name']. " (";
echo "module " $counter['Name']. " (";
 
 
if ($inputs['clear']=="1") { echo "clear,"; }
if ($inputs['clear']=="1") { echo " clear,"; }
if ($inputs['set']=="1")   { echo " set,"; }
if ($inputs['set']=="1")   { echo " set,"; }
if ($inputs['cke']=="1")   { echo "cke, "; }
if ($inputs['cke']=="1")   { echo " cke,"; }
if ($inputs['rew']=="1")   { echo " rew,"; }
if ($inputs['rew']=="1")   { echo " rew,"; }
 
 
if ($outputs['q']=="1")      { echo " q,"; }
if ($outputs['q']=="1")      { echo " q,"; }
if ($outputs['q_bin']=="1")  { echo " q_bin,"; }
if ($outputs['q_bin']=="1")  { echo " q_bin,"; }
if ($outputs['z']=="1")      { echo " z,"; }
if ($outputs['z']=="1")      { echo " z,"; }
Line 250... Line 250...
echo "       qi <= q_next;" PHP_EOL;
echo "       qi <= q_next;" PHP_EOL;
echo PHP_EOL;
echo PHP_EOL;
 
 
if ($outputs['q']) {
if ($outputs['q']) {
    if ($counter['type'] == "GRAY" or $counter['type'] == "gray") {
    if ($counter['type'] == "GRAY" or $counter['type'] == "gray") {
        echo "always @ (posedge clk or posedge rst)
        echo "   always @ (posedge clk or posedge rst)
     if (rst)
     if (rst)
       q <= (q_next>>1) ^ q_next;
       q <= {length{1'b0}};
     else" PHP_EOL;
     else" PHP_EOL;
        if ($inputs['cke']) { echo "       if (cke)" PHP_EOL; }
        if ($inputs['cke']) { echo "       if (cke)" PHP_EOL; }
        echo "         q <= (q_next>>1) ^ q_next;" PHP_EOL;
        echo "         q <= (q_next>>1) ^ q_next;" PHP_EOL;
 
        if ($outputs['q_bin']) { echo PHP_EOL "   assign q_bin = qi;" PHP_EOL; }
    } else {
    } else {
        echo "   assign q = qi;" PHP_EOL;
        echo "   assign q = qi;" PHP_EOL;
    }
    }
}
}
echo PHP_EOL;
echo PHP_EOL;

powered by: WebSVN 2.1.0

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