forked from m-labs/milkymist
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Unified signal crossing sync by single module implementation and prop…
…er instatiation in top module
- Loading branch information
1 parent
89687e1
commit 6dd7b0e
Showing
2 changed files
with
61 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Milkymist SoC GPS-SDR | ||
| * Copyleft 2011 Cristian Paul Peñaranda Rojas | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 3 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| module namuru_ssync( | ||
| input i, | ||
| input clks, | ||
| input o | ||
| ); | ||
|
|
||
| reg level1; | ||
| reg level2; | ||
| reg level3; | ||
| reg level4; | ||
| always @(posedge clkss) begin | ||
| level1 <= i; | ||
| level2 <= level1; | ||
| level3 <= level2; | ||
| level4 <= level3; | ||
| end | ||
|
|
||
| //assign o = level3 & level4; | ||
| assign o = level4; | ||
|
|
||
| initial begin | ||
| level1 <= 1'b0; | ||
| level2 <= 1'b0; | ||
| level3 <= 1'b0; | ||
| level4 <= 1'b0; | ||
| end | ||
|
|
||
| endmodule |