⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcic_c.tdf

📁 Altera AHDL语言设计的PCI总线
💻 TDF
📖 第 1 页 / 共 5 页
字号:
			ELSE GENERATE
				IF (BAR1_OVFL_N == 0) GENERATE
					ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 8589934592 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Non-Prefetchable"
					32-BAR1_READ_ONLY_BITS --32-BAR1_READ_ONLY_BITS_0 -- 2^63
					SEVERITY INFO;
				ELSE GENERATE
--					IF (BAR1_READ_ONLY_BITS_0 == 30) GENERATE
--					ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 4294967269 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Non-Prefetchable"
--						32-BAR1_READ_ONLY_BITS_0 -- 2^62
--						SEVERITY INFO;
--					END GENERATE;		
--					IF (BAR1_READ_ONLY_BITS_0 == 29) GENERATE
--						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 2147483648 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Non-Prefetchable"
--						32-BAR1_READ_ONLY_BITS_0 -- 2^61
--						SEVERITY INFO;
--					END GENERATE;			
--					IF (BAR1_READ_ONLY_BITS_0 == 28) GENERATE
--						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size =  % GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Non-Prefetchable"
--						32-BAR1_READ_ONLY_BITS_0, 1073741824 DIV (2^(28-BAR1_READ_ONLY_BITS_0))  -- 2^60
--						SEVERITY INFO;
--					END GENERATE;		
					IF (BAR1_READ_WRITE_BITS < 8) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size =  % GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Non-Prefetchable"
						BAR1_READ_WRITE_BITS%32-BAR1_READ_ONLY_BITS_0%,  %(2^(28-BAR1_READ_ONLY_BITS_0)) DIV 1073741824%1073741824 DIV (2^(28-BAR1_READ_ONLY_BITS_0))
						SEVERITY INFO;
					END GENERATE;						
				
				END GENERATE;
			END GENERATE;		
		END GENERATE;
		
		IF (BAR0_MEM_LOC == 2 and BAR0_PREFETCH == 1 ) GENERATE
			IF (BAR0_READ_ONLY_BITS_32 < 32) GENERATE
				IF (BAR0_OVFL_N == 0) GENERATE
					ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 2 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
					64-BAR_64BIT_ROB_BAR0
					SEVERITY INFO;
				ELSE GENERATE				
					IF (CEIL(2^BAR0_READ_ONLY_BITS) >=   1073741824) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = % GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						64-BAR_64BIT_ROB_BAR0, (2^BAR0_READ_ONLY_BITS) DIV  1073741824
						SEVERITY INFO;
					END GENERATE;
					IF (CEIL(2^BAR0_READ_ONLY_BITS) >=  1048576 and (CEIL(2^BAR0_READ_ONLY_BITS) <   1073741824)) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = % MBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						64-BAR_64BIT_ROB_BAR0, CEIL(2^BAR0_READ_ONLY_BITS) DIV 1048576 
						SEVERITY INFO;
					END GENERATE;
					IF((CEIL(2^BAR0_READ_ONLY_BITS) >= 1024)  and (CEIL(2^BAR0_READ_ONLY_BITS) < 1048576)) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = % KBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						64-BAR_64BIT_ROB_BAR0, CEIL(2^BAR0_READ_ONLY_BITS) DIV 1024
						SEVERITY INFO;
					END GENERATE;
					IF (CEIL(2^BAR0_READ_ONLY_BITS) < 1024) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = % Bytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						64-BAR_64BIT_ROB_BAR0, CEIL(2^BAR0_READ_ONLY_BITS)
						SEVERITY INFO;
					END GENERATE;
				END GENERATE;

			ELSE GENERATE
				IF (BAR1_OVFL_N == 0) GENERATE
					ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 8589934592 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
					32-BAR1_READ_ONLY_BITS --32-BAR1_READ_ONLY_BITS_0 -- 2^63
					SEVERITY INFO;
				ELSE GENERATE
					IF (BAR1_READ_ONLY_BITS_0 == 30) GENERATE
					ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 4294967269 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS_0 -- 2^62
						SEVERITY INFO;
					END GENERATE;		
					IF (BAR1_READ_ONLY_BITS_0 == 29) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size = 2147483648 GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS_0 -- 2^61
						SEVERITY INFO;
					END GENERATE;			
					IF (BAR1_READ_ONLY_BITS_0 == 28) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size =  % GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS_0, 1073741824 DIV (2^(28-BAR1_READ_ONLY_BITS_0))  -- 2^60
						SEVERITY INFO;
					END GENERATE;		
					IF (BAR1_READ_WRITE_BITS < 8) GENERATE
						ASSERT REPORT "BAR0 and BAR1 Settings: Number of Address Bits Decoded = %, Size =  % GBytes, Type = Memory, Location = Anywhere in the 64 Bit address Space, Prefetchable"
						BAR1_READ_WRITE_BITS%32-BAR1_READ_ONLY_BITS_0%,  %(2^(28-BAR1_READ_ONLY_BITS_0)) DIV 1073741824%1073741824 DIV (2^(28-BAR1_READ_ONLY_BITS_0))
						SEVERITY INFO;
					END GENERATE;						
				
				END GENERATE;
			END GENERATE;		
		END GENERATE;

		IF (BAR0_MEM_LOC > 2) GENERATE
			ASSERT REPORT " Illegal Memory Type Value for BAR0 "
			SEVERITY ERROR;
		end GENERATE;

	end GENERATE;

	-- Set BAR0 R/W Registers Controls

IF (BAR0_READ_ONLY_BITS_32 < 32) GENERATE -- BAR0 Read Only Bits < 32

	bar0_reg[].clk	= clk ;
	bar0_reg[].clrn	= rstN;
	
	IF (LOCAL_CONFIG_ENA == "NO") GENERATE
		bar0_reg[].d	= ad_IR[31..BAR0_READ_ONLY_BITS];
	ELSE  GENERATE
		bar0_reg[].d	= lcfg_dat_in[31..Bar0_Read_ONLY_BITS];
	END GENERATE;

	IF (BAR0_READ_ONLY_BITS < 8) GENERATE
		bar0_reg[31..24].ena						= bar0_ena[3];
		bar0_reg[23..16].ena						= bar0_ena[2];
		bar0_reg[15..8].ena							= bar0_ena[1];
		bar0_reg[7..BAR0_READ_ONLY_BITS].ena	= bar0_ena[0];
	ELSE GENERATE		
		IF (BAR0_READ_ONLY_BITS < 16) GENERATE		
			bar0_reg[31..24].ena						= bar0_ena[3];
			bar0_reg[23..16].ena						= bar0_ena[2];
			bar0_reg[15..BAR0_READ_ONLY_BITS].ena	= bar0_ena[1];
		ELSE GENERATE 			
			IF (BAR0_READ_ONLY_BITS < 24) GENERATE			
				bar0_reg[31..24].ena						= bar0_ena[3];
				bar0_reg[23..BAR0_READ_ONLY_BITS].ena	= bar0_ena[2];			
			ELSE GENERATE			
				bar0_reg[31..BAR0_READ_ONLY_BITS].ena	= bar0_ena[3];
			END GENERATE;
		END GENERATE;
	END GENERATE;

END GENERATE;


	-- Set the 32 bit value of BAR0
	-- This was added because I/O Base Address register can have only 16 bytes available
IF (BAR0_READ_ONLY_BITS_32 < 32) GENERATE
		IF (BAR0_READ_ONLY_BITS > 4) GENERATE
			bar[0][] = (bar0_reg[],bar0_ro_bits[BAR0_READ_ONLY_BITS-1..4],(bar_nibble[0][]));
		ELSE GENERATE
			bar[0][] = (bar0_reg[],(bar_nibble[0][]));
		END GENERATE;
ELSE GENERATE
		bar[0][] = (bar0_ro_bits[BAR0_READ_ONLY_BITS_32-1..4],(bar_nibble[0][]));
END GENERATE;



	-- Connect The Ports of BAR0 Address Comparator

-- If BAR0=H"00000004(C)", READ_ONLY_BITS is greater than or equal to 32.  Therefore, only bar_hit[1] should be evaluated.

IF (BAR0_MEM_LOC < 2) GENERATE

		bar0_comp.dataa[]	= bar0_reg[] ;
		bar0_comp.datab[]	= ad_IR_addr[31 .. BAR0_READ_ONLY_BITS];	-- Only Upper Most Address Bits are Decoded
		bar_hit_lc1 = LCELL(NOT bar_nibble[0][0] and mem_cyc and mem_access_enable and not dac_cfg);
		bar_hit_lc2 = LCELL(bar_nibble[0][0] and io_cyc and io_access_enable);
		bar_hit_lc3 = LCELL( adr_phase and ( 	(	 bar_hit_lc1)
																		OR	(	 bar_hit_lc2)
																	   )
												   );
		bar_hit[0] 	= bar0_comp.aeb and bar_hit_lc3;

ELSE GENERATE

	IF (BAR0_READ_ONLY_BITS_32 < 32) GENERATE
			bar0_comp.dataa[]	= bar0_reg[] ;
			bar0_comp.datab[]	= ad_IR_addr[31 .. BAR0_READ_ONLY_BITS];	-- Only Upper Most Address Bits are Decoded

--			bar_hit[0] 		= bar0_comp.aeb and lcell ( adr_phase and ( 	(	NOT bar_nibble[0][0] and (mem_cyc %or dac_cfg%) and mem_access_enable and dac_cfg)
--																		--OR	(	bar_nibble[0][0]	 and io_cyc and io_access_enable)
--																	   )
--												   );
			bar_hit_lc1 	= LCELL(NOT bar_nibble[0][0] and mem_cyc and mem_access_enable and dac_cfg);
			bar_hit_lc2 	= lcell ( adr_phase and ( bar_hit_lc1	  )
												   );
			bar_hit_lc3		= gnd;
			bar_hit[0] 		= bar0_comp.aeb and bar_hit_lc2;

	ELSE GENERATE
			bar_hit[0] = bar_hit[1];
	END GENERATE;

END GENERATE;

	dac_config_sr.clk = clk;
	dac_config_sr.clrn = rstn;
	dac_config_sr.s	= gnd;
	dac_config_sr.r = vcc;

	-- Set BAR0 Address Compare Hit Register Controls
	
	bar_hitR[0].clk		= clk;
	bar_hitR[0].clrn 	= rstN;
							
	bar_hitR[0].r	= bar_hit_rst;
	bar_hitR[0].s	= bar_hit[0] ;

ELSE GENERATE
	bar_hit[5..0]	= GND;
	bar_selR[0]		= GND ;		-- Bar0 Register Select
	bar_hitR[5..0].clk = Clk;
	bar_hitR[5..0].clrn = rstN;
	bar_hitR[5..0].r = bar_hit_rst;
	bar_hitR[5..0].s	= GND;
	bar[5..0][]		= H"00000000";

END GENERATE;

IF (NUMBER_OF_BARS >= 1+1) GENERATE

	junk[]				= junk[] or bar1_ena3 or bar1_ena2 or bar1_ena1 or bar1_ena0 or dac_cfg;

	bar_selR[1]			= cfg_adr_dec_tmp_node[1];
	
	IF (LOCAL_CONFIG_ENA == "NO") GENERATE	
		bar1_ena[3..0]		= bar_selR[1] and cfg_dat_vld and not(cben_IR[3..0]);	
	ELSE  GENERATE
		bar1_ena[3..0]		= bar_selR[1] and lcfg_dat_vld and not lcfg_ben[3..0];	
	END GENERATE;

	IF (BAR0_MEM_LOC < 2) GENERATE	
		IF (BAR1_READ_ONLY_BITS > 4) GENERATE
			bar1_ro_bits[BAR1_READ_ONLY_BITS-1..4] 	= GND;			-- BAR1 Read Only Bits
		END GENERATE;
	ELSE GENERATE
		IF (BAR1_OVFL_N == 0) GENERATE
			bar1_ro_bits[BAR1_READ_ONLY_BITS-1..0] 	= GND;			-- BAR1 Read Only Bits
		ELSE GENERATE
			IF (BAR1_READ_ONLY_BITS_0 > 0) GENERATE
				bar1_ro_bits_upper[31..8] = gnd;
				bar1_ro_bits_lower[BAR1_READ_ONLY_BITS_0-1..0] 	= GND;			-- BAR1 Read Only Bits
			ELSE GENERATE
				bar1_ro_bits_upper[31..8] = gnd;				
			END GENERATE;
		END GENERATE;
	END GENERATE;

	-- Check and REPORT value supplied for BAR1
--	IF (1 == 1) GENERATE ASSERT REPORT "this is bar 1" severity info; END GENERATE;
  	IF (BAR0_MEM_LOC < 2) GENERATE
		IF (BAR1_TYPE == 1) GENERATE
			IF (BAR1_MEM_LOC == 0 and BAR1_PREFETCH == 0 ) GENERATE
				ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % Bytes, Type = I/O"
					32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS)
				SEVERITY INFO;
			ELSE GENERATE 
				ASSERT REPORT " Illegal Value [%] for BAR1 Parameter" BAR1
				SEVERITY ERROR;
			END GENERATE;
		ELSE GENERATE
			IF (BAR1_MEM_LOC == 0 and BAR1_PREFETCH == 0 ) GENERATE
				IF (BAR1_OVFL_N == 0) GENERATE
					ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = 2 GBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Non-Prefetchable"
					32-BAR1_READ_ONLY_BITS 
					SEVERITY INFO;
				ELSE GENERATE
				
					IF (CEIL(2^BAR1_READ_ONLY_BITS) >=   1073741824) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % GBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Non-Prefetchable"
						32-BAR1_READ_ONLY_BITS, (2^BAR1_READ_ONLY_BITS) DIV  1073741824
						SEVERITY INFO;
					END GENERATE;
					IF (CEIL(2^BAR1_READ_ONLY_BITS) >=  1048576 and (CEIL(2^BAR1_READ_ONLY_BITS) <   1073741824)) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % MBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Non-Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS) DIV 1048576 
						SEVERITY INFO;
					END GENERATE;
					IF((CEIL(2^BAR1_READ_ONLY_BITS) >= 1024)  and (CEIL(2^BAR1_READ_ONLY_BITS) < 1048576)) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % KBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Non-Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS) DIV 1024
						SEVERITY INFO;
					END GENERATE;
					IF (CEIL(2^BAR1_READ_ONLY_BITS) < 1024) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % Bytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Non-Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS)
						SEVERITY INFO;
					END GENERATE;			
				END GENERATE;		
			END GENERATE;
		
			IF (BAR1_MEM_LOC == 0 and BAR1_PREFETCH == 1 ) GENERATE
				IF (BAR1_OVFL_N == 0) GENERATE
					ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = 2 GBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Prefetchable"
					32-BAR1_READ_ONLY_BITS 
					SEVERITY INFO;
				ELSE GENERATE
				
					IF (CEIL(2^BAR1_READ_ONLY_BITS) >=   1073741824) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % GBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS) DIV  1073741824
						SEVERITY INFO;
					END GENERATE;
					IF (CEIL(2^BAR1_READ_ONLY_BITS) >=  1048576 and (CEIL(2^BAR1_READ_ONLY_BITS) <   1073741824)) GENERATE
						ASSERT REPORT "BAR0 Settings: Number of Address Bits Decoded = %, Size = % MBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS) DIV 1048576 
						SEVERITY INFO;
					END GENERATE;
					IF((CEIL(2^BAR1_READ_ONLY_BITS) >= 1024)  and (CEIL(2^BAR1_READ_ONLY_BITS) < 1048576)) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % KBytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS) DIV 1024
						SEVERITY INFO;
					END GENERATE;
					IF (CEIL(2^BAR1_READ_ONLY_BITS) < 1024) GENERATE
						ASSERT REPORT "BAR1 Settings: Number of Address Bits Decoded = %, Size = % Bytes, Type = Memory, Location = Anywhere in the 32 Bit address Space, Prefetchable"
						32-BAR1_READ_ONLY_BITS, CEIL(2^BAR1_READ_ONLY_BITS)
						SEVERITY INFO;
					END GENERATE;
				END GENERATE;	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -