
indexing

	description: "A die on a run"
	author: "David Hollenberg"
	date: "July 27, 2004"

deferred class ABSTRACT_DIE
inherit
	NULL_VALUE_CHECK_ACCESS

feature -- Properties

	die_id: STRING is
			-- Identifying name within run
		deferred
		end

	die_type: STRING is
			-- Type of die (customer die, test vehicle, scribe,
			-- etc.)
		deferred
		end

	die_wafer_rotation: INTEGER is
			-- Clockwise rotation of die on wafer, in degrees
		deferred
		end

	design_no: INTEGER is
			-- Design number associated with die
		require
			is_project: is_project
		deferred
		end

	is_rotated_sideways: BOOLEAN is
			-- Is die rotated by 90 degrees clockwise or
			-- 90 degrees counterclockwise?
		do
			Result := die_wafer_rotation = 90 or die_wafer_rotation = 270
		end

	has_die_type (s: STRING): BOOLEAN is
			-- Is `die_type' equal to `s'?
		require
			string_exists: s /= Void
		do
			Result := die_type.is_equal (s)
		end

	is_test_vehicle: BOOLEAN is
			-- Is die a test vehicle?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Test_vehicle)
		end

	is_cust_die: BOOLEAN is
			-- Is die a customer die?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Cust_die)
		end

	is_vendor_ghost: BOOLEAN is
			-- Is die a vendor ghost?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Vendor_ghost)
		end

	is_vendor_geometry: BOOLEAN is
			-- Is die a vendor geometry?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Vendor_geometry)
		end

	is_vendor_geometry_or_ghost: BOOLEAN is
			-- Is die a vendor geometry or vendor_ghost
		do
			Result := is_vendor_geometry or is_vendor_ghost
		end

	is_not_vendor_ghost: BOOLEAN is
			-- Is die not a vendor ghost?
		do
			Result := not is_vendor_ghost
		end

	is_scribe: BOOLEAN is
			-- Is die a scribe?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Scribe)
		end

	is_non_scribe: BOOLEAN is
			-- Is die not a scribe?
		do
			Result := not is_scribe
		end

	is_horizontal_scribe: BOOLEAN is
			-- Is die a horizontal scribe?
		local
			orient: ORIENTATION_VALUES
		do
			Result := is_scribe and then scribe_orientation.is_equal (orient.Horizontal)
		end

	is_vertical_scribe: BOOLEAN is
			-- Is die a vertical scribe?
		local
			orient: ORIENTATION_VALUES
		do
			Result := is_scribe and then scribe_orientation.is_equal (orient.Vertical)
		end

	is_filler: BOOLEAN is
			-- Is die a filler?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Filler)
		end

	is_macrocell: BOOLEAN is
			-- Is die a macrocell?
		local
			dtype: DIE_TYPE_VALUES
		do
			Result := has_die_type (dtype.Macrocell)
		end

	scribe_orientation: STRING is
			-- Orientation of scribe (horizontal or vertical)
		deferred
		end

	is_project: BOOLEAN is
			-- Is die an actual project (not scribe or
			-- vendor geometry)?
		do
			Result := is_cust_die or is_test_vehicle
		end

	needs_overhead_file: BOOLEAN is
			-- Does die need an overhead layout file?
		do
			Result := is_cust_die or is_test_vehicle
		end

	selects_designated_dt: BOOLEAN is
			-- Does die particpate in selection of
			-- designated design techn?
		do
			Result := is_cust_die or is_test_vehicle
		end

	has_die_size: BOOLEAN is
			-- Does `Current' have a die size?
		do
			Result := not is_null_die_size_printed_x and not is_null_die_size_printed_y
		end

	printed_size_on_wafer: CONST_POINT is
			-- Size of printed die (including overhead)
			-- in microns on the wafer, in a coordinate system
			-- where Y axis goes from bottom of wafer to top
			-- when wafer is in an upright position
		require
			has_die_size: has_die_size
		do
			create Result.make_xy (non_null_die_size_printed_x, non_null_die_size_printed_y)
		end

	upright_printed_size: CONST_POINT is
			-- Size of printed die (including overhead)
			-- in microns when die is upright
		require
			has_die_size: has_die_size
			has_rotation: not is_null_die_wafer_rotation
		local
			rot: INTEGER
			x, y: DOUBLE
		do
			rot := non_null_die_wafer_rotation
			x := non_null_die_size_printed_x
			y := non_null_die_size_printed_y
			if rot = 0 or rot = 180 then
				create Result.make_xy (x, y)
			else
				create Result.make_xy (y, x)
			end
		end

	printed_size_with_rotation (b: BOOLEAN): CONST_POINT is
			-- Size of printed die (including overhead)
			-- in microns on the wafer, in a coordinate system
			-- where Y axis goes from bottom of wafer to top
			-- when wafer is in an upright position and then
			-- rotated if `b' is true
		require
			has_die_size: has_die_size
		do
			Result := printed_size_on_wafer
			if b then
				create Result.make_xy (Result.y, Result.x)
			end
		end

	die_size_printed_x: DOUBLE is
			-- X coordinate of size of printed die on wafer
			-- (including overhead) in microns
		deferred
		end

	die_size_printed_y: DOUBLE is
			-- Y coordinate of size of printed die on wafer
			-- (including overhead) in microns
		deferred
		end

	is_null_die_size_printed_x: BOOLEAN is
			-- Is `die_size_printed_x' null?
		deferred
		end

	is_null_die_size_printed_y: BOOLEAN is
			-- Is `die_size_printed_y' null?
		deferred
		end

	is_null_die_wafer_rotation: BOOLEAN is
			-- Is `die_wafer_rotation' null?
		deferred
		end

	non_null_die_size_printed_x: like die_size_printed_x is
			-- Value of `die_size_printed_x', with error check 
			-- for nullness
		do
			check_not_null ("die_size_printed_x", is_null_die_size_printed_x, Current)
			Result := die_size_printed_x
		end

	non_null_die_size_printed_y: like die_size_printed_y is
			-- Value of `die_size_printed_y', with error check 
			-- for nullness
		do
			check_not_null ("die_size_printed_y", is_null_die_size_printed_y, Current)
			Result := die_size_printed_y
		end

	non_null_die_wafer_rotation: like die_wafer_rotation is
			-- Value of `die_wafer_rotation', with error check 
			-- for nullness
		do
			check_not_null ("die_wafer_rotation", is_null_die_wafer_rotation, Current)
			Result := die_wafer_rotation
		end

end
