Rev 3582 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3582 | Rev 3591 | ||
---|---|---|---|
1 | # |
1 | # |
2 | # This configuration file was assembled from the bagle machine |
2 | # This configuration file was assembled from the bagle machine |
3 | # configuration files as found in Simics 3.0.21. It won't probably |
3 | # configuration files as found in Simics 3.0.21. It won't probably |
4 | # work in Simics versions prior to Simics 3.0. |
4 | # work in Simics versions prior to Simics 3.0. |
5 | # |
5 | # |
6 | # The machine simulated is SunFire server Sun Enterprise E6500. |
6 | # The machine simulated is SunFire server Sun Enterprise E6500. |
7 | # |
7 | # |
8 | # - modified to boot from CD-ROM |
8 | # - modified to boot from CD-ROM |
9 | # - framebuffer color depth set to 24bpp |
9 | # - framebuffer color depth set to 24bpp |
10 | # |
10 | # |
11 | 11 | ||
12 | script-branch { |
12 | script-branch { |
13 | wait-for-variable machine_defined |
13 | wait-for-variable machine_defined |
14 | $pcibrd = (create-sunfire-pci-board mac_address = "10:10:10:10:10:14") |
14 | $pcibrd = (create-sunfire-pci-board mac_address = "10:10:10:10:10:14") |
15 | $pgx64 = (create-sun-pci-pgx64) |
15 | $pgx64 = (create-sun-pci-pgx64) |
16 | $gfxcon = (create-std-graphics-console) |
16 | $gfxcon = (create-std-graphics-console) |
17 | $keyboard = (create-sun-type5-keyboard) |
17 | $keyboard = (create-sun-type5-keyboard) |
18 | $mouse = (create-sun-type5-mouse) |
18 | $mouse = (create-sun-type5-mouse) |
19 | $scsi_bus = (create-std-scsi-bus) |
19 | $scsi_bus = (create-std-scsi-bus) |
20 | 20 | ||
21 | $system.connect slot2 $pcibrd |
21 | $system.connect slot2 $pcibrd |
22 | $pcibrd.connect pci-slot0 $pgx64 |
22 | $pcibrd.connect pci-slot0 $pgx64 |
23 | $pcibrd.connect $scsi_bus |
23 | $pcibrd.connect $scsi_bus |
24 | $system.connect keyboard $keyboard |
24 | $system.connect keyboard $keyboard |
25 | $system.connect mouse $mouse |
25 | $system.connect mouse $mouse |
26 | 26 | ||
27 | $gfxcon.connect $pgx64 |
27 | $gfxcon.connect $pgx64 |
28 | $gfxcon.connect $keyboard |
28 | $gfxcon.connect $keyboard |
29 | $gfxcon.connect $mouse |
29 | $gfxcon.connect $mouse |
30 | } |
30 | } |
31 | 31 | ||
32 | $save_slot2 = "yes" |
32 | $save_slot2 = "yes" |
33 | 33 | ||
34 | if not defined hostid {$hostid = 0x80804a6c} |
34 | if not defined hostid {$hostid = 0x80804a6c} |
35 | if not defined freq_mhz {$freq_mhz = 168} |
35 | if not defined freq_mhz {$freq_mhz = 168} |
36 | if not defined mac_address {$mac_address = "10:10:10:10:10:12"} |
36 | if not defined mac_address {$mac_address = "10:10:10:10:10:12"} |
37 | if not defined disk_size {$disk_size = 2128486400} |
37 | if not defined disk_size {$disk_size = 2128486400} |
38 | if not defined rtc_time {$rtc_time = "2002-06-02 13:00:00 UTC"} |
38 | if not defined rtc_time {$rtc_time = "2002-06-02 13:00:00 UTC"} |
39 | if not defined num_cpus {$num_cpus = 5} |
39 | if not defined num_cpus {$num_cpus = 2} |
40 | if not defined memory_megs {$memory_megs = 256} |
40 | if not defined memory_megs {$memory_megs = 256} |
41 | if not defined save_slot2 {$save_slot2 = "no"} |
41 | if not defined save_slot2 {$save_slot2 = "no"} |
42 | 42 | ||
43 | add-directory "%simics%/targets/sunfire/images/" |
43 | add-directory "%simics%/targets/sunfire/images/" |
44 | 44 | ||
45 | import-pci-components |
45 | import-pci-components |
46 | import-std-components |
46 | import-std-components |
47 | import-sun-components |
47 | import-sun-components |
48 | import-sunfire-components |
48 | import-sunfire-components |
49 | 49 | ||
50 | $system = (create-sunfire-6500-backplane cpu_frequency = $freq_mhz |
50 | $system = (create-sunfire-6500-backplane cpu_frequency = $freq_mhz |
51 | hostid = $hostid |
51 | hostid = $hostid |
52 | mac_address = $mac_address |
52 | mac_address = $mac_address |
53 | rtc_time = $rtc_time) |
53 | rtc_time = $rtc_time) |
54 | 54 | ||
55 | $board = 0 |
55 | $board = 0 |
56 | $cpus_left = $num_cpus |
56 | $cpus_left = $num_cpus |
57 | $megs_left = $memory_megs |
57 | $megs_left = $memory_megs |
58 | 58 | ||
59 | while $cpus_left or $megs_left { |
59 | while $cpus_left or $megs_left { |
60 | $cpubrd[$board] = (create-sunfire-cpu-board |
60 | $cpubrd[$board] = (create-sunfire-cpu-board |
61 | num_cpus = (min $cpus_left 2) |
61 | num_cpus = (min $cpus_left 2) |
62 | memory_megs = (min $megs_left 4096)) |
62 | memory_megs = (min $megs_left 4096)) |
63 | $system.connect ("slot" + $board) $cpubrd[$board] |
63 | $system.connect ("slot" + $board) $cpubrd[$board] |
64 | if $board == 0 { |
64 | if $board == 0 { |
65 | $system.connect central-cpu $cpubrd[$board] |
65 | $system.connect central-cpu $cpubrd[$board] |
66 | } |
66 | } |
67 | $cpus_left = (max ($cpus_left - 2) 0) |
67 | $cpus_left = (max ($cpus_left - 2) 0) |
68 | $megs_left = (max ($megs_left - 4096) 0) |
68 | $megs_left = (max ($megs_left - 4096) 0) |
69 | $board += 1 |
69 | $board += 1 |
70 | if $board == 1 {$board = 2} |
70 | if $board == 1 {$board = 2} |
71 | if $board == 2 and ($save_slot2 == yes) {$board = 3} |
71 | if $board == 2 and ($save_slot2 == yes) {$board = 3} |
72 | } |
72 | } |
73 | 73 | ||
74 | $sbusbrd = (create-sunfire-sbus-board mac_address = $mac_address) |
74 | $sbusbrd = (create-sunfire-sbus-board mac_address = $mac_address) |
75 | $scsi_bus = (create-std-scsi-bus) |
75 | $scsi_bus = (create-std-scsi-bus) |
76 | $scsi_disk = (create-std-scsi-disk scsi_id = 1 size = $disk_size) |
76 | $scsi_disk = (create-std-scsi-disk scsi_id = 1 size = $disk_size) |
77 | $scsi_cdrom = (create-std-scsi-cdrom scsi_id = 6) |
77 | $scsi_cdrom = (create-std-scsi-cdrom scsi_id = 6) |
78 | $console = (create-std-text-console) |
78 | $console = (create-std-text-console) |
79 | 79 | ||
80 | $system.connect slot1 $sbusbrd |
80 | $system.connect slot1 $sbusbrd |
81 | $sbusbrd.connect $scsi_bus |
81 | $sbusbrd.connect $scsi_bus |
82 | $scsi_bus.connect $scsi_disk |
82 | $scsi_bus.connect $scsi_disk |
83 | $scsi_bus.connect $scsi_cdrom |
83 | $scsi_bus.connect $scsi_cdrom |
84 | $system.connect ttya $console |
84 | $system.connect ttya $console |
85 | 85 | ||
86 | $machine_defined = 1 |
86 | $machine_defined = 1 |
87 | 87 | ||
88 | instantiate-components |
88 | instantiate-components |
89 | 89 | ||
90 | $eth_comp = $sbus_fas_hme |
90 | $eth_comp = $sbus_fas_hme |
91 | $eth_cnt = "" |
91 | $eth_cnt = "" |
92 | run-command-file "%simics%/targets/common/add-eth-link.include" |
92 | run-command-file "%simics%/targets/common/add-eth-link.include" |
93 | 93 | ||
94 | if not defined ip_address {$ip_address = "10.10.0.6"} |
94 | if not defined ip_address {$ip_address = "10.10.0.6"} |
95 | 95 | ||
96 | if $service_node { |
96 | if $service_node { |
97 | local $sn = ($service_node.get-component-object sn) |
97 | local $sn = ($service_node.get-component-object sn) |
98 | ($sn.add-host name = $host_name |
98 | ($sn.add-host name = $host_name |
99 | ip = $ip_address domain = network.sim |
99 | ip = $ip_address domain = network.sim |
100 | mac = $mac_address) |
100 | mac = $mac_address) |
101 | } |
101 | } |
102 | 102 | ||
103 | default-port-forward-target $ip_address |
103 | default-port-forward-target $ip_address |
104 | 104 | ||
105 | $cdrom_path = "image.iso" |
105 | $cdrom_path = "image.iso" |
106 | ($scsi_cdrom.get-component-object cd).insert (new-file-cdrom $cdrom_path) |
106 | ($scsi_cdrom.get-component-object cd).insert (new-file-cdrom $cdrom_path) |
107 | 107 | ||
108 | $system.set-prom-env boot-command "boot cdrom" |
108 | $system.set-prom-env boot-command "boot cdrom" |
109 | $system.set-prom-env auto-boot? true |
109 | $system.set-prom-env auto-boot? true |
110 | $system.set-prom-env "output-device" "screen:r1152x900x76x24" |
110 | $system.set-prom-env "output-device" "screen:r1152x900x76x24" |
111 | 111 | ||
112 | @buf = 0; |
112 | @buf = 0; |
113 | @offset = 0; |
113 | @offset = 0; |
114 | @register2Number = SIM_get_register_number(SIM_current_processor(), "g2"); |
114 | @register2Number = SIM_get_register_number(SIM_current_processor(), "g2"); |
115 | @register3Number = SIM_get_register_number(SIM_current_processor(), "g3"); |
115 | @register3Number = SIM_get_register_number(SIM_current_processor(), "g3"); |
116 | 116 | ||
117 | @def schedule(): |
117 | @def schedule(): |
118 | SIM_realtime_event(100, handler, 0, 0, ''); |
118 | SIM_realtime_event(100, handler, 0, 0, ''); |
119 | 119 | ||
120 | @def handler(x): |
120 | @def handler(x): |
121 | global buf |
121 | global buf |
122 | global offset |
122 | global offset |
123 | if (SIM_simics_is_running()): |
123 | if (SIM_simics_is_running()): |
124 | register2Value = SIM_read_register(SIM_current_processor(), register2Number); |
124 | register2Value = SIM_read_register(SIM_current_processor(), register2Number); |
125 | if ((buf == 0) and register2Value == 0x18273645): |
125 | if ((buf == 0) and register2Value == 0x18273645): |
126 | buf = SIM_read_register(SIM_current_processor(), register3Number); |
126 | buf = SIM_read_register(SIM_current_processor(), register3Number); |
127 | SIM_write_register(SIM_current_processor(), register2Number, 0); |
127 | SIM_write_register(SIM_current_processor(), register2Number, 0); |
128 | SIM_flush(); |
128 | SIM_flush(); |
129 | print buf |
129 | print buf |
130 | elif (buf != 0): |
130 | elif (buf != 0): |
131 | byte = SIM_read_phys_memory(SIM_current_processor(), buf + offset, 1); |
131 | byte = SIM_read_phys_memory(SIM_current_processor(), buf + offset, 1); |
132 | while byte != 0: |
132 | while byte != 0: |
133 | SIM_putchar(byte); |
133 | SIM_putchar(byte); |
134 | SIM_flush(); |
134 | SIM_flush(); |
135 | SIM_write_phys_memory(SIM_current_processor(), buf + offset, 0, 1); |
135 | SIM_write_phys_memory(SIM_current_processor(), buf + offset, 0, 1); |
136 | offset = (offset + 1) % 512; |
136 | offset = (offset + 1) % 512; |
137 | byte = SIM_read_phys_memory(SIM_current_processor(), buf + offset, 1); |
137 | byte = SIM_read_phys_memory(SIM_current_processor(), buf + offset, 1); |
138 | schedule(); |
138 | schedule(); |
139 | 139 | ||
140 | @schedule(); |
140 | @schedule(); |
141 | 141 |