In order to modify the database safely, you should export RegDefSDK_bts to local (.xsl file.)

• !!!Notice: please backup the DB before all your work.

	1. Enter the folder: SVNRoot/RegDefSDK/mysql_dba/  (putty)
	2. Run: ./backup_database.sh [program name].  Such as ./backup_database.sh  RegDefSDK_bts
• Add Entrance For New Program
	1. create empty database for Mullins (MySQL) -> (RegDefSDK_AM) using dbvisualizer
		§ Server: btsinventor 
		§ User: sa
		§ Password: sa
	2. modify BTS inventor source code -> use putty 
		○ server: btsinventor
		○ user: schen
		○ password: letmein
	2.1 modify file:  ~\SVNRoot\RegDefSDK\config\database.yml added Amur section

add Amur

	2.2 added new file ~\SVNRoot\RegDefSDK\config\environments\amur.rb in environment folder (copy from kryptos.rb and rename)
	2.3 added new entry in ~\SVNRoot\RegDefSDK\app\controllers\home_controller.rb,
    - add new program to program_list otherwise, the website will not show the program. 

Add entry

	3. modify /opt/nginx/conf/nginx.conf
		i. Added new port in this  file (by Putty)

Add new port

	4. create link RegDefSDK_ML point to RegDefSDK in folder  /home/schen/SVNRoot/
		i. ln -s /home/schen/SVNRoot/RegDefSDK   RegDefSDK_ML
	5.  restart nginx by:   ./etc/init.d/nginx restart
	6.  run script:   ./run_migrate.sh  mullins    (~/SVNRoot/RegDefSDK)   --> it will create the empty tables and the data will be set by "export" later
	7.  add entrance for new Program in BTSInventor -> edit RegDefSDK_common::ip_blocks -> e.g. : add 9020 port for Nolan & FCH			
	8. Add program_id for new program RegDefSDK_bts::bts_programs  -> e.g. Kabini -> 1 

Database

DB Modification

• the Database Model you should know
	○ device ---device_type_id---> device_pattern
	○ device_pattern -> access method::script_id
	○ script_id -> script(read Register) 
	○ Shunt items ---include exclude pattern---> export the lua package we need
• the Tables you may edit:
	○ RegDefSDK_common::ip_blocks -> entrance of btsinventor
	○ RegDefSDK_bts::bts_programs  -> id for all programs
	○ RegDefSDK_bts::device type -> known device types of all programs
	○ RegDefSDK_bts::devices -> devices of all programs by BKDG
	○ RegDefSDK_bts::access method -> access method script_id for all devices & device::register
	○ RegDefSDK_bts::scripts -> read register lua function for all device types
	○ RegDefSDK_bts::platform variables -> some variables write in BKDG
		§ Ddr4Mode#dct0 -> D18F2x78_dct0[DramType] == 2
		
• List all the devices&register instances by looking up BKDG
	o List all Core&GPU&NB Devices
		§ Add the device information to the table according to the picture below
		§ Tip: all the devices in this part may have the device type id (Known)
		§ Tip: if the device has existed in the “device_types table”,then add DeviceTypeID to your list 
		§ Tip: add the index/data registers pair to Special Instance. -> E.g : D0F0x60/D0F0x64
		§ Tip: some device may not have the device ID, you can use D18F2 deviceID instead. E.g : MISC GPIO
		§ Rule: mark the unknown device type with “n”

list all core devices

	o List all FCH Devices
			§ Add devices information to the table according to the picture below.
			§ Tips: a lot of the devices in this part may be unknown.
			§ Rule: mark all the root device in red. -> E.g : SATA Controller
			§ Rule: mark all the ignored device( no need to test ) in gray.  -> E.g : Legacy Block Configuration Registers(IO)
			§ Rule: mark all the new devices you want to add in yellow
			§ Rule: mark the unknown device type with “n” 

list all FCH devices

• Modify Database offline
	o Create new files named with “newDeviceTypes.xls” & “FCHDevices.xls” & “OtherDevices.xls” 
	o Add new device_types (the content you marked in yellow) into “newDeviceTypes.xls” 
		§ E.g: it shows how to add new device type to table by the picture below
	o Add new “access_methods” & “script” for new device_type according to BKDG. E.g : MISCx*
		§ Script Rule: the read method may need to wirte some register, so it is important to restore the original register value.
		§ Add script according to BKDG Info -> this is a difficult part in New Program Support., see the picture below
		§ Tip: if you have some trouble in using BTS function like btsSetBitField, you can see the existed scripts for reference.

Add Access Methods

	o Add core&GPU&NB devices to “OtherDevices.xls” 
		§ Tip: there is a easy way to add devices -> copy a existed program to modify
		§ Tip: you can simply change the device ID to add known devices 

Add new device tip

	o Add FCH Devices to “FCHDevices.xls”
		§ Follow the tips mentioned in previous step to add all FCH devices.
	o Classify the export errors & Add Platform Variables to “PV.xls”
		§ you can run export code after you finish all the step above -> \\reg_def_sdk\client\python\exportlua 
		§ You will see the errors “Error: Cannot resolve symbol:”.
		§ Classify all the errors according to the picture below, all the symbol should be solved according to BKDG
		§ Tips : you can skip the "FUSE. Metal Bump SKIPRESET BOZO See" error

Skip fuse

		§ Add the Platform Variables to “PV.xls” and commit your change after making sure all the contents are correct.
		§ when database updated, re-export the lua package again
• Commit your change to database
	o Append RegDefSDK_bts::devices_types with “newDeviceTypes.xls” data, make sure the id must not be repeated.
	o Append RegDefSDK_bts::devices with “FCHDevices.xls” & “otherDevices.xls”data, make sure the id must not be repeated.
	o Append “RegDefSDK_bts::Platform_Variables” with “PV.xls” data, make sure all the contents are correct.
•  modify file:  \Source\btsapp\bts\res\PrefabFiles\common
	o Unzip the common package with 7-zip
	o Calculate family ID according the following method

cal family id

	§ Tip : You can get Fn0000_0001 EAX by using SimNow : "CPUID 1"
	§ Calculate FCH familyID : [deviceID,vendorID,revisionID]
	§ !!!Notice:   if(expectFamilyId == (existSBFamilyId & 0xFFFFFFFFF0))         //Remove minor revision 
	§  E.g. Amur : DeviceID ->  790Bh vendorID ->  1022h revisionID  51h  ==>  790B102251 (519876649553)  => remove the minior revison  ==>  790B102200(519876649472)
o Edit DeviceFamilyIds.lua::get_program_folder(deviceID) to make bts support new program  according to picture below. -> Nolan support 

Add family ID

o Edit program_revision.lua::get_processor_revision()  (socket type + revision ) to update BKDG information accordingly

edit revision

o Edit Source\btsapp\bts\res\Common\DeviceFamilyIds.lua & program_revision.lua as well
o Commit all your change to 8.0.10 & trunk

• If all the steps have done, BTS will support the new program.

  • For ARM Arc program support –> need to change the interface of this BTS & SimNow


Published

18 June 2014

Category

AMD

Tags