📄 cf_interleaver_9_32.py
字号:
## Copyright (c) 2003 Launchbird Design Systems, Inc.# All rights reserved.# # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:# Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.# 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.# # # Overview:# # Memory interleavers are often used in DSP for reordering continuous streaming data.# The interleaver is comprised of two interleaving memories. One memory loads and# reorders data, while the other memory dumps the data to the output.# Once loading and dumping of data are complete, the memories reverse roles.# The dumping memory continuously cycles though the entire memory starting at address 0.# # Interface:# # Synchronization:# clock_c : Clock input.# # Inputs:# swap_i : Swap signal to interleave memories. Pulse occurs one frame before the switch# and may coincide with the last input data.# write_i : Write enable for input data.# addr_i : Address for input data.# data_i : Input data.# # Outputs:# sync_primary_o : Output sync plus occurs one frame before data new dump.# sync_secondary_o : Secondary sync plus occurs one frame before data at address 0 is dumped.# data_o : Output data.# # Built In Parameters:# # Address Width = 9# Data Width = 32# # # # # Generated by Confluence 0.6.3 -- Launchbird Design Systems, Inc. -- www.launchbird.com# # Build Date : Fri Aug 22 09:33:17 CDT 2003# # Interface# # Build Name : cf_interleaver_9_32# Clock Domains : clock_c # Vector Input : swap_i(1)# Vector Input : write_i(1)# Vector Input : addr_i(9)# Vector Input : data_i(32)# Vector Output : sync_primary_o(1)# Vector Output : sync_secondary_o(1)# Vector Output : data_o(32)# # # import sysimport timeclass cf_interleaver_9_32: def init(self): self.n84 = 0L self.n80 = 0L self.n79 = 0L self.n58 = 0L self.n28 = 0L self.n27 = 0L self.n26 = 0L self.n25 = 0L self.n22 = 0L self.n21 = 0L self.n20 = 0L self.n19 = 0L self.n18 = 0L self.n17 = 0L self.n16 = 0L self.n7 = 0L self.n6 = 0L self.n5 = 0L self.n4 = 0L self.n3 = 0L self.n2 = 0L self.n1 = 0L self.n82 = 0L self.n59 = 0L self.n57 = 0L self.n57r = 0L self.n57e = 0L self.n57d = 0L self.n32 = 0L self.n10 = 0L self.n81 = 0L self.n45 = 0L self.n44 = 0L self.n35 = 0L self.n34 = 0L self.n33 = 0L self.n15 = 0L self.n15r = 0L self.n15e = 0L self.n15d = 0L self.n48 = 0L self.n36 = 0L self.n49 = 0L self.n37 = 0L self.n66 = 0L self.n50 = 0L self.n38 = 0L self.n78 = 0L self.n78r = 0L self.n78e = 0L self.n78d = 0L self.n71 = 0L self.n71e = 0L self.n71w = 0L self.n71aw = 0L self.n71ar = 0L self.n71dw = 0L self.n71m = [0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,0L,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.n58 = 0x000L self.n28 = 0x2L self.n27 = 0x0L self.n26 = 0x0L self.n25 = 0x0L self.n22 = 0x1L self.n21 = 0x2L self.n20 = 0x0L self.n19 = 0x0L self.n18 = 0x1L self.n17 = 0x1L self.n16 = 0x0L self.n7 = 0x001L self.n6 = data_i self.n5 = addr_i self.n4 = write_i self.n3 = swap_i self.n2 = 0x0L self.n1 = 0x1L data_o = self.n79 self.n82 = self.n79 if self.n15 == self.n58: self.n59 = 1L else: self.n59 = 0L self.n57r = self.n2 self.n57e = self.n1 self.n57d = self.n3 self.n32 = self.n3 << 1 | self.n43 self.n10 = (self.n15 + self.n7) & 0x1FFL sync_secondary_o = self.n59 self.n81 = self.n59 if self.n32 == self.n28: self.n45 = 1L else: self.n45 = 0L if self.n32 == self.n27: self.n44 = 1L else: self.n44 = 0L if self.n32 == self.n22: self.n35 = 1L else: self.n35 = 0L if self.n32 == self.n21: self.n34 = 1L else: self.n34 = 0L if self.n32 == self.n20: self.n33 = 1L else: self.n33 = 0L self.n15r = self.n3 self.n15e = self.n1 self.n15d = self.n10 if self.n45: self.n48 = self.n25 else: self.n48 = self.n84 if self.n35: self.n36 = self.n17 else: self.n36 = self.n16 if self.n44: self.n49 = self.n26 else: self.n49 = self.n48 if self.n34: self.n37 = self.n18 else: self.n37 = self.n36 self.n66 = self.n4 & self.n49 self.n50 = ~self.n49 & 0x1L if self.n33: self.n38 = self.n19 else: self.n38 = self.n37 self.n78r = self.n2 self.n78e = self.n1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -