MVME187Machine.cc Source File

Back to the index.

MVME187Machine.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2019 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  * NOTE:
36  * =====
37  *
38  * MVME88k emulation is already implemented in the old framework. The code
39  * you are looking at now is a complete rewrite using the new framework.
40  *
41  *
42  *
43  *
44  * MVME187 according to http://mcg.motorola.com/us/products/docs/pdf/187igd.pdf
45  * ("MVME187 RISC Single Board Computer Installation Guide"):
46  *
47  * 88100 MPU, two MC88200 or MC88204 CMMUs (one for data cache and
48  * one for instruction cache).
49  * 82596CA LAN Ethernet
50  * 53C710 SCSI
51  * CD2401 SCC SERIAL IO
52  * PRINTER PORT
53  * MK48T08 BBRAM & CLOCK
54  * EPROM
55  * VME bus
56  *
57  * ... and more details from OpenBSD/mvme88k sources:
58  *
59  * 0xff800000 .. 0xffbfffff = BUG PROM
60  * 0xffe00000 .. 0xffe1ffff = BUG SRAM
61  * 0xfff00000 = PCCTWO
62  * 0xfff40000 = VME bus
63  * 0xfff43000 = MEMC040 (Memory controller)
64  * 0xfff45000 = CD2401 SCC SERIAL IO (cl0)
65  * 0xfff46000 = 82596 Ethernet (ie0)
66  * 0xfff47000 = 53C710 SCSI (osiop0)
67  * 0xfffc0000 = MK48T08 (nvram0)
68  *
69  * Note: It may turn out to be easier to support Lance ethernet (via VME)
70  * than to support the 82596 ethernet controller.
71  */
72 
73 
75 {
76  // Defaults:
78  settings["ram"] = "0x2000000";
79 
81  return NULL;
82 
85  if (machine.IsNULL())
86  return NULL;
87 
88  machine->SetVariableValue("template", "\"mvme187\"");
89 
90  refcount_ptr<Component> mainbus =
92  if (mainbus.IsNULL())
93  return NULL;
94 
95  machine->AddChild(mainbus);
96 
98  if (ram.IsNULL())
99  return NULL;
100 
101  ram->SetVariableValue("memoryMappedSize", settings["ram"]);
102  mainbus->AddChild(ram);
103 
105  if (rom.IsNULL())
106  return NULL;
107 
108  rom->SetVariableValue("name", "\"rom0\"");
109  rom->SetVariableValue("memoryMappedBase", "0xff800000");
110  rom->SetVariableValue("memoryMappedSize", "0x400000");
111  mainbus->AddChild(rom);
112 
114  ComponentFactory::CreateComponent("m88k_cpu(model=88100)");
115 
116  if (cpu.IsNULL())
117  return NULL;
118 
119  mainbus->AddChild(cpu);
120 
121  return machine;
122 }
123 
124 
125 string MVME187Machine::GetAttribute(const string& attributeName)
126 {
127  if (attributeName == "template")
128  return "yes";
129 
130  if (attributeName == "machine")
131  return "yes";
132 
133  if (attributeName == "description")
134  return "MVME187 machine.";
135 
136  if (attributeName == "comments")
137  return "For experiments with <a href=\"http://www.openbsd.org/mvme88k.html\">OpenBSD/mvme88k</a>.";
138 
139  return "";
140 }
141 
refcount_ptr::IsNULL
bool IsNULL() const
Checks whether or not an object is referenced by the reference counted pointer.
Definition: refcount_ptr.h:218
ComponentFactory::GetCreationArgOverrides
static bool GetCreationArgOverrides(ComponentCreationSettings &settings, const ComponentCreateArgs &createArgs)
Get override arguments for component creation.
Definition: ComponentFactory.cc:151
Component::AddChild
void AddChild(refcount_ptr< Component > childComponent, size_t insertPosition=(size_t) -1)
Adds a reference to a child component.
Definition: Component.cc:595
ComponentFactory.h
MVME187Machine::GetAttribute
static string GetAttribute(const string &attributeName)
Gets a Component attribute value.
Definition: MVME187Machine.cc:125
refcount_ptr< Component >
machine
Definition: machine.h:97
ComponentFactory::CreateComponent
static refcount_ptr< Component > CreateComponent(const string &componentNameAndOptionalArgs, GXemul *gxemul=NULL)
Creates a component given a short component name.
Definition: ComponentFactory.cc:87
Component::SetVariableValue
bool SetVariableValue(const string &name, const string &expression)
Sets a variable to a new value.
Definition: Component.cc:1030
settings
Definition: settings.cc:57
ComponentCreationSettings
map< string, string > ComponentCreationSettings
Definition: Component.h:46
MVME187Machine.h
cpu
Definition: cpu.h:326
ComponentCreateArgs
Definition: Component.h:49
MVME187Machine::Create
static refcount_ptr< Component > Create(const ComponentCreateArgs &args)
Creates a MVME187 Component tree.
Definition: MVME187Machine.cc:74

Generated on Tue Aug 25 2020 19:25:06 for GXemul by doxygen 1.8.18