OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librw11/] [Rw11Cpu.cpp] - Diff between revs 20 and 21

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 20 Rev 21
Line 1... Line 1...
// $Id: Rw11Cpu.cpp 506 2013-04-14 21:54:03Z mueller $
// $Id: Rw11Cpu.cpp 516 2013-05-05 21:24:52Z mueller $
//
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
//
// This program is free software; you may redistribute and/or modify it under
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// the terms of the GNU General Public License as published by the Free
Line 18... Line 18...
// 2013-01-27   478   0.1    First draft
// 2013-01-27   478   0.1    First draft
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
 
 
/*!
/*!
  \file
  \file
  \version $Id: Rw11Cpu.cpp 506 2013-04-14 21:54:03Z mueller $
  \version $Id: Rw11Cpu.cpp 516 2013-05-05 21:24:52Z mueller $
  \brief   Implemenation of Rw11Cpu.
  \brief   Implemenation of Rw11Cpu.
*/
*/
#include <stdlib.h>
#include <stdlib.h>
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
Line 397... Line 397...
{
{
  int fd = open(fname.c_str(), O_RDONLY);
  int fd = open(fname.c_str(), O_RDONLY);
 
 
  if (fd < 0) {
  if (fd < 0) {
    emsg.InitErrno("Rw11Cpu::LoadAbs()", string("open() for '") + fname +
    emsg.InitErrno("Rw11Cpu::LoadAbs()", string("open() for '") + fname +
                   string("' failed: "), errno);
                   "' failed: ", errno);
    return false;
    return false;
  }
  }
 
 
  enum states {
  enum states {
    s_chr0,
    s_chr0,
Line 588... Line 588...
      cname.push_back(c);
      cname.push_back(c);
    }
    }
  }
  }
 
 
  if (!TestCntl(cname)) {
  if (!TestCntl(cname)) {
    emsg.Init("Rw11Cpu::Boot", string("controller '") + cname +
    emsg.Init("Rw11Cpu::Boot", string("controller '") + cname + "' not known");
              string("' not known"));
 
    return false;
    return false;
  }
  }
 
 
  // FIXME_code: unit number not checked. Cntl doesn't even know about ...
  // FIXME_code: unit number not checked. Cntl doesn't even know about ...
 
 
Line 603... Line 602...
  uint16_t aload = 0;
  uint16_t aload = 0;
  uint16_t astart = 0;
  uint16_t astart = 0;
 
 
  if (!cntl.BootCode(uind, code, aload, astart) || code.size()==0) {
  if (!cntl.BootCode(uind, code, aload, astart) || code.size()==0) {
    emsg.Init("Rw11Cpu::Boot", string("boot not supported for controller '")
    emsg.Init("Rw11Cpu::Boot", string("boot not supported for controller '")
              + cname + string("'"));
              + cname + "'");
    return false;
    return false;
  }
  }
 
 
  if (!MemWrite(aload, code, emsg)) return false;
  if (!MemWrite(aload, code, emsg)) return false;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.