LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
    Date: Fri May 13 22:17:13 CEST 2005
    Subject: [openrisc] [or1ksim #86] Remove test peripheral
    Top
    Hi,

    This removes the test peripheral. It is used nowhere and it was becoming a
    burden on maintance: Whenever an interface changed (I did this alot..) the test
    peripheral also had to be updated. There are enough peripherals without haveing
    to have to update some useless code all the time. The test peripheral also
    used except_handle which I'd say is not recomended in a peripheral (and giveing
    a bad example for future peripheral writers). After #82 there is the memory
    peripheral which can serve as a replacement `test' peripheral if it is really
    needed.

    The new #82 depends on this patch to be applied before it, odly enough.

    ChangeLog:
    * Remove nolonger used test peripheral.

    nog.
    -------------- next part --------------
    --- /hd0/or1k/or1k/or1ksim/sim-config.c 2005-03-31 16:39:39.000000000 +0200
    +++ sim-config.c 2005-05-13 16:22:33.000000000 +0200
    @@ -616,7 +616,6 @@
    reg_kbd_sec();
    reg_ata_sec();
    reg_cuc_sec();
    - reg_test_sec();
    }

    /* Returns a user friendly string of type */
    --- /hd0/or1k/or1k/or1ksim/sim-config.h 2005-03-31 16:39:39.000000000 +0200
    +++ sim-config.h 2005-05-13 16:22:39.000000000 +0200
    @@ -337,5 +337,4 @@
    void reg_kbd_sec(void);
    void reg_ata_sec(void);
    void reg_cuc_sec(void);
    -void reg_test_sec(void);
    #endif
    --- /hd0/or1k/or1k/or1ksim/peripheral/Makefile.am 2002-10-25 20:19:35.000000000 +0200
    +++ peripheral/Makefile.am 2005-05-13 16:20:34.000000000 +0200
    @@ -33,5 +33,4 @@
    ps2kbd.c \
    atahost.c \
    atadevice.c \
    -atadevice_cmdi.c \
    -test.c
    +atadevice_cmdi.c
    --- peripheral/test.c 2005-05-13 16:24:41.000000000 +0200
    +++ /dev/null 2003-01-07 18:22:11.000000000 +0100
    @@ -1,87 +0,0 @@
    -#include <stdio.h>
    -
    -#include "config.h"
    -
    -#ifdef HAVE_INTTYPES_H
    -#include <inttypes.h>
    -#endif
    -
    -#include "port.h"
    -#include "arch.h"
    -#include "sim-config.h"
    -#include "abstract.h"
    -#include "except.h"
    -
    -struct test_config {
    - uint32_t array[128];
    - oraddr_t baseaddr;
    -};
    -
    -/* Test write */
    -void test_write32 (oraddr_t addr, uint32_t value, void *dat)
    -{
    - struct test_config *test = dat;
    -
    - if (addr & 0x00000080)
    - test->array[addr & 0x7f] = value;
    - else
    - except_handle(EXCEPT_BUSERR, cur_vadd);
    -}
    -
    -/* Test read */
    -uint32_t test_read32 (oraddr_t addr, void *dat)
    -{
    - struct test_config *test = dat;
    -
    - if (addr & 0x00000080)
    - return ~test->array[addr & 0x7f];
    - else
    - except_handle(EXCEPT_BUSERR, cur_vadd);
    - return 0x00000000;
    -}
    -
    -void test_reset (void *dat)
    -{
    - struct test_config *test = dat;
    - int i;
    -
    - for (i = 0; i < 128; i++)
    - test->array[i] = 0x00000000;
    -}
    -
    -/*---------------------------------------------------[ Test configuration ]---*/
    -void test_baseaddr(union param_val val, void *dat)
    -{
    - struct test_config *test = dat; - test->baseaddr = val.addr_val; -} - -void *test_sec_start(void) -{ - struct test_config *test = malloc(sizeof(struct test_config)); - - if(!test) { - fprintf(stderr, "Peripheral Test: Run out of memory\n"); - exit(-1); - } - - test->baseaddr = 0; - - return test; -} - -void test_sec_end(void *dat) -{ - struct test_config *test = dat; - if(test->baseaddr) - register_memoryarea(test->baseaddr, 256, 4, 0, test_read32, test_write32, NULL); - reg_sim_reset(test_reset, dat); -} - -void reg_test_sec(void) -{ - struct config_section *sec = reg_config_sec("test", test_sec_start, - test_sec_end); - - reg_config_param(sec, "baseaddr", paramt_addr, test_baseaddr); -}

    Follow upAuthor
    [openrisc] [or1ksim #86] Remove test peripheralMatjaz Breskvar

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.