MVME187Machine.cc Source File

Back to the index.

MVME187Machine.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2010 Anders Gavare. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. The name of the author may not be used to endorse or promote products
13  * derived from this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
29 #include "ComponentFactory.h"
30 
31 
32 /*
33  * This is for experiments with OpenBSD/mvme88k.
34  *
35  * MVME187 according to http://mcg.motorola.com/us/products/docs/pdf/187igd.pdf
36  * ("MVME187 RISC Single Board Computer Installation Guide"):
37  *
38  * 88100 MPU, two MC88200 or MC88204 CMMUs (one for data cache and
39  * one for instruction cache).
40  * 82596CA LAN Ethernet
41  * 53C710 SCSI
42  * CD2401 SCC SERIAL IO
43  * PRINTER PORT
44  * MK48T08 BBRAM & CLOCK
45  * EPROM
46  * VME bus
47  *
48  * ... and more details from OpenBSD/mvme88k sources:
49  *
50  * 0xff800000 .. 0xffbfffff = BUG PROM
51  * 0xffe00000 .. 0xffe1ffff = BUG SRAM
52  * 0xfff00000 = PCCTWO
53  * 0xfff40000 = VME bus
54  * 0xfff43000 = MEMC040 (Memory controller)
55  * 0xfff45000 = CD2401 SCC SERIAL IO (cl0)
56  * 0xfff46000 = 82596 Ethernet (ie0)
57  * 0xfff47000 = 53C710 SCSI (osiop0)
58  * 0xfffc0000 = MK48T08 (nvram0)
59  *
60  * Note: It may turn out to be easier to support Lance ethernet (via VME)
61  * than to support the 82596 ethernet controller.
62  */
63 
64 
66 {
67  // Defaults:
69  settings["ram"] = "0x2000000";
70 
71  if (!ComponentFactory::GetCreationArgOverrides(settings, args))
72  return NULL;
73 
76  if (machine.IsNULL())
77  return NULL;
78 
79  machine->SetVariableValue("template", "\"mvme187\"");
80 
81  refcount_ptr<Component> mainbus =
83  if (mainbus.IsNULL())
84  return NULL;
85 
86  machine->AddChild(mainbus);
87 
89  if (ram.IsNULL())
90  return NULL;
91 
92  ram->SetVariableValue("memoryMappedSize", settings["ram"]);
93  mainbus->AddChild(ram);
94 
96  if (rom.IsNULL())
97  return NULL;
98 
99  rom->SetVariableValue("name", "\"rom0\"");
100  rom->SetVariableValue("memoryMappedBase", "0xff800000");
101  rom->SetVariableValue("memoryMappedSize", "0x400000");
102  mainbus->AddChild(rom);
103 
105  ComponentFactory::CreateComponent("m88k_cpu(model=88100)");
106 
107  if (cpu.IsNULL())
108  return NULL;
109 
110  mainbus->AddChild(cpu);
111 
112  return machine;
113 }
114 
115 
116 string MVME187Machine::GetAttribute(const string& attributeName)
117 {
118  if (attributeName == "template")
119  return "yes";
120 
121  if (attributeName == "machine")
122  return "yes";
123 
124  // if (attributeName == "stable")
125  // return "yes";
126 
127  if (attributeName == "description")
128  return "MVME187 machine.";
129 
130  if (attributeName == "comments")
131  return "For experiments with <a href=\"http://www.openbsd.org/mvme88k.html\">OpenBSD/mvme88k</a>.";
132 
133  return "";
134 }
135 
static refcount_ptr< Component > Create(const ComponentCreateArgs &args)
Creates a MVME187 Component tree.
static refcount_ptr< Component > CreateComponent(const string &componentNameAndOptionalArgs, GXemul *gxemul=NULL)
Creates a component given a short component name.
map< string, string > ComponentCreationSettings
Definition: Component.h:46
static string GetAttribute(const string &attributeName)
Gets a Component attribute value.
Definition: cpu.h:326
bool SetVariableValue(const string &name, const string &expression)
Sets a variable to a new value.
Definition: Component.cc:1030
void AddChild(refcount_ptr< Component > childComponent, size_t insertPosition=(size_t) -1)
Adds a reference to a child component.
Definition: Component.cc:595
static bool GetCreationArgOverrides(ComponentCreationSettings &settings, const ComponentCreateArgs &createArgs)
Get override arguments for component creation.
bool IsNULL() const
Checks whether or not an object is referenced by the reference counted pointer.
Definition: refcount_ptr.h:216

Generated on Sun Sep 30 2018 16:05:18 for GXemul by doxygen 1.8.13