-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,303 additions
and
1 deletion.
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,66 @@ | ||
-------------------------------------------------------------------------------- | ||
-- Copyright (c) 2016, Mathias Herlev | ||
-- All rights reserved. | ||
-- | ||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions are met: | ||
-- | ||
-- 1. Redistributions of source code must retain the above copyright notice, | ||
-- this list of conditions and the following disclaimer. | ||
-- 2. Redistributions in binary form must reproduce the above copyright notice, | ||
-- this list of conditions and the following disclaimer in the documentation | ||
-- and/or other materials provided with the distribution. | ||
-- | ||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
-- POSSIBILITY OF SUCH DAMAGE. | ||
-------------------------------------------------------------------------------- | ||
-- Title : OCPBurst Interface Types | ||
-- Type : Type Package | ||
-- Description : Record types for OCPburst CDC interface | ||
-------------------------------------------------------------------------------- | ||
LIBRARY ieee; | ||
USE ieee.std_logic_1164.all; | ||
LIBRARY work; | ||
USE work.ocp.all; | ||
|
||
PACKAGE OCPBurstCDC_types IS | ||
|
||
TYPE OCPBurstCDCIn_r IS | ||
RECORD | ||
clk_A : std_logic; | ||
rst_A : std_logic; | ||
clk_B : std_logic; | ||
rst_B : std_logic; | ||
OCPB_slave : ocp_burst_s; | ||
OCPB_master : ocp_burst_m; | ||
END RECORD; | ||
|
||
TYPE OCPBurstCDCOut_r IS | ||
RECORD | ||
OCPB_A : ocp_burst_s; | ||
OCPB_B : ocp_burst_m; | ||
END RECORD; | ||
|
||
TYPE AsyncBurst_A_r IS | ||
RECORD | ||
req : std_logic; | ||
Data : ocp_burst_m; | ||
RegAddr : std_logic_vector(1 downto 0); | ||
END RECORD; | ||
|
||
TYPE AsyncBurst_B_r IS | ||
RECORD | ||
ack : std_logic; | ||
Data : ocp_burst_s; | ||
RegAddr : std_logic_vector(1 downto 0); | ||
END RECORD; | ||
END OCPBurstCDC_types; |
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,65 @@ | ||
-------------------------------------------------------------------------------- | ||
-- Copyright (c) 2016, Mathias Herlev | ||
-- All rights reserved. | ||
-- | ||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions are met: | ||
-- | ||
-- 1. Redistributions of source code must retain the above copyright notice, | ||
-- this list of conditions and the following disclaimer. | ||
-- 2. Redistributions in binary form must reproduce the above copyright notice, | ||
-- this list of conditions and the following disclaimer in the documentation | ||
-- and/or other materials provided with the distribution. | ||
-- | ||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
-- POSSIBILITY OF SUCH DAMAGE. | ||
-------------------------------------------------------------------------------- | ||
-- Title : OCPBurst Interface Types | ||
-- Type : Type Package | ||
-- Description : Record types for OCPio CDC interface | ||
-------------------------------------------------------------------------------- | ||
LIBRARY ieee; | ||
USE ieee.std_logic_1164.all; | ||
LIBRARY work; | ||
USE work.ocp.all; | ||
PACKAGE OCPIOCDC_types IS | ||
|
||
TYPE OCPIOCDCIn_r IS | ||
RECORD | ||
clk_A : std_logic; | ||
rst_A : std_logic; | ||
clk_B : std_logic; | ||
rst_B : std_logic; | ||
ocpio_B : ocp_io_s; | ||
ocpio_A : ocp_io_m; | ||
END RECORD; | ||
|
||
TYPE OCPIOCDCOut_r IS | ||
RECORD | ||
ocpio_A : ocp_io_s; | ||
ocpio_B : ocp_io_m; | ||
END RECORD; | ||
|
||
TYPE asyncIO_A_r IS | ||
RECORD | ||
req : std_logic; | ||
data : ocp_io_m; | ||
END RECORD; | ||
|
||
TYPE asyncIO_B_r IS | ||
RECORD | ||
ack : std_logic; | ||
data : ocp_io_s; | ||
END RECORD; | ||
|
||
|
||
END OCPIOCDC_types; |
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,47 @@ | ||
-------------------------------------------------------------------------------- | ||
-- Copyright (c) 2016, Mathias Herlev | ||
-- All rights reserved. | ||
-- | ||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions are met: | ||
-- | ||
-- 1. Redistributions of source code must retain the above copyright notice, | ||
-- this list of conditions and the following disclaimer. | ||
-- 2. Redistributions in binary form must reproduce the above copyright notice, | ||
-- this list of conditions and the following disclaimer in the documentation | ||
-- and/or other materials provided with the distribution. | ||
-- | ||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
-- POSSIBILITY OF SUCH DAMAGE. | ||
-------------------------------------------------------------------------------- | ||
-- Title : OCPBurst Interface Types | ||
-- Type : Type Package | ||
-- Description : Idle constants | ||
-------------------------------------------------------------------------------- | ||
LIBRARY ieee; | ||
USE ieee.std_logic_1164.all; | ||
LIBRARY work; | ||
USE work.ocp.all; | ||
|
||
|
||
PACKAGE OCPInterface IS | ||
|
||
CONSTANT OCPBurstMasterIdle_c : ocp_burst_m := (OCP_CMD_IDLE, | ||
(OTHERS => '0'), | ||
(OTHERS => '0'), | ||
(OTHERS => '0'), | ||
|
||
CONSTANT OCPBurstSlaveIdle_c : ocp_burst_s := (OCP_RESP_NULL, | ||
(OTHERS => '0'), | ||
'0', | ||
'0'); | ||
END OCPInterface; |
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,84 @@ | ||
-------------------------------------------------------------------------------- | ||
-- Copyright (c) 2016, Mathias Herlev | ||
-- All rights reserved. | ||
-- | ||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions are met: | ||
-- | ||
-- 1. Redistributions of source code must retain the above copyright notice, | ||
-- this list of conditions and the following disclaimer. | ||
-- 2. Redistributions in binary form must reproduce the above copyright notice, | ||
-- this list of conditions and the following disclaimer in the documentation | ||
-- and/or other materials provided with the distribution. | ||
-- | ||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
-- POSSIBILITY OF SUCH DAMAGE. | ||
-------------------------------------------------------------------------------- | ||
-- Title : OCPBurst Clock Crossing Interface | ||
-- Type : Entity | ||
-- Description : OCPburst CDC wrapper | ||
-------------------------------------------------------------------------------- | ||
LIBRARY ieee; | ||
USE ieee.std_logic_1164.all; | ||
LIBRARY work; | ||
USE work.OCPBurstCDC_types.all; | ||
USE work.ocp.all; | ||
ENTITY OCPBurstCDC IS | ||
PORT( input : IN OCPBurstCDCIn_r; | ||
output : OUT OCPBurstCDCOut_r | ||
); | ||
END ENTITY OCPBurstCDC; | ||
|
||
ARCHITECTURE rtl OF OCPBurstCDC IS | ||
|
||
COMPONENT OCPBurstCDC_A IS | ||
PORT( clk : IN std_logic; | ||
rst : IN std_logic; | ||
syncIn : IN ocp_burst_m; | ||
syncOut : OUT ocp_burst_s; | ||
asyncOut : OUT AsyncBurst_A_r; | ||
asyncIn : IN AsyncBurst_B_r | ||
); | ||
END COMPONENT OCPBurstCDC_A; | ||
|
||
COMPONENT OCPBurstCDC_B IS | ||
PORT( clk : IN std_logic; | ||
rst : IN std_logic; | ||
syncIn : IN ocp_burst_s; | ||
syncOut : OUT ocp_burst_m; | ||
asyncOut : OUT AsyncBurst_B_r; | ||
asyncIn : IN AsyncBurst_A_r | ||
); | ||
END COMPONENT OCPBurstCDC_B; | ||
|
||
SIGNAL async_A : AsyncBurst_A_r; | ||
SIGNAL async_B : AsyncBurst_B_r; | ||
|
||
BEGIN | ||
|
||
CDC_A : OCPBurstCDC_A | ||
PORT MAP(input.clk_A, | ||
input.rst_A, | ||
input.OCPB_master, | ||
output.OCPB_A, | ||
async_A, | ||
async_B); | ||
|
||
CDC_B : OCPBurstCDC_B | ||
PORT MAP(input.clk_B, | ||
input.rst_B, | ||
input.OCPB_slave, | ||
output.OCPB_B, | ||
async_B, | ||
async_A); | ||
|
||
END ARCHITECTURE rtl; |
Oops, something went wrong.