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

Subversion Repositories sqmusic

[/] [sqmusic/] [trunk/] [ver/] [sq_opn_basic.v] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 gryzor
/*
2
        SQmusic
3
 
4
  (c) Jose Tejada Gomez, 9th May 2013
5
  You can use this file following the GNU GENERAL PUBLIC LICENSE version 3
6
  Read the details of the license in:
7
  http://www.gnu.org/licenses/gpl.txt
8
 
9
  Send comments to: jose.tejada@ieee.org
10
 
11
*/
12
 
13
`timescale 1ns/1ps
14
 
15
module sq_opn_basic;
16
 
17
reg clk, reset_n;
18 20 gryzor
reg [6:0] gain;
19
wire signed [13:0] linear;
20 18 gryzor
 
21 20 gryzor
parameter fnumber = 11'h40E;
22
parameter block   =  3'h4;
23 18 gryzor
parameter multiple=  4'h1;
24
 
25
initial begin
26
  $dumpvars(0,sq_opn_basic);
27
  $dumpon;
28
  reset_n = 0;
29 20 gryzor
  gain = 7'd0;
30 18 gryzor
  #300 reset_n=1;
31 19 gryzor
  $display("SOUND START");
32 20 gryzor
  #0.01e9
33
  forever #0.01e9 begin
34
    if( gain == 7'h7F )
35
      $finish;
36
    else
37
      gain <= gain + 1;
38
//    if( $realtime > 64*0.01e9 ) $finish;
39
  end
40
//  $finish;
41 18 gryzor
end
42
 
43
always begin
44
  clk = 0;
45 20 gryzor
  forever #(125/2) clk = ~clk & reset_n;
46 18 gryzor
end
47
 
48
sq_slot slot(
49
        .clk     (clk),
50
        .reset_n (reset_n),
51
        .fnumber (fnumber),
52
        .block   (block),
53 19 gryzor
  .multiple(multiple),
54 20 gryzor
  .totallvl(gain),
55 19 gryzor
  .linear  (linear)
56 18 gryzor
);
57 19 gryzor
 
58 20 gryzor
//always #(1e9/44100) $display("%d", linear);
59 18 gryzor
 
60
 
61
endmodule

powered by: WebSVN 2.1.0

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