###############################################################################
##
## Copyright (c) 2003 Xilinx, Inc. All Rights Reserved.
## DO NOT COPY OR MODIFY THIS FILE. 
## THIS IS IN AN EXPERIMENTAL STAGE AND MIGHT CHANGE IN FUTURE RELEASE.
##
## lmb_bram_if_cntlr_v2_1_0.tcl
##
###############################################################################


#***--------------------------------***------------------------------------***
#
# 		         SYSLEVEL_DRC_PROC
#
#***--------------------------------***------------------------------------***

#
# lmb_bram_if_cntlr memory controller is connected to a bram block
#
proc check_syslevel_settings { mhsinst } {

    set instname   [xget_value $mhsinst "parameter" "INSTANCE"]

    set busif  [xget_value $mhsinst "bus_interface" "BRAM_PORT"]

    if {[string length $busif] == 0} {

	puts  "WARNING: $instname memory controller is not connected to a bram block"

    }

}

#***--------------------------------***------------------------------------***
#
#			     IPLEVEL_DRC_PROC
#
#***--------------------------------***------------------------------------***

#
# check C_BASEADDR != 0xFFFFFFFF
#       C_HIGHADDR != 0x00000000
#

proc check_iplevel_settings {mhsinst} {

    set base_param "C_BASEADDR"
    set high_param "C_HIGHADDR"
    set base_addr [xget_value $mhsinst "parameter" $base_param]
    set high_addr [xget_value $mhsinst "parameter" $high_param]

    if {[compare_unsigned_addr_strings $base_addr $base_param $high_addr $high_param] == 1} {

	set ipname [xget_value $mhsinst "option" "ipname"]
        error "Invalid $ipname parameter:\nYou must set the value for $base_param and $high_param" "" "libgen_error"

    }

}
